📄 listframe.java~5~
字号:
package control;import java.awt.*;import java.awt.event.*;import javax.swing.*;public class ListFrame extends JFrame { JPanel contentPane; JScrollPane jScrollPane1 = new JScrollPane(); JList jList1 = new JList(); public ListFrame() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { contentPane = (JPanel) this.getContentPane(); contentPane.setLayout(null); this.setSize(new Dimension(400, 300)); this.setTitle("List示例"); jScrollPane1.setBounds(new Rectangle(80, 37, 240, 190)); jScrollPane1.getViewport().add(jList1, null); contentPane.add(jScrollPane1, null); } protected void processWindowEvent(WindowEvent e) { if (e.getID() == WindowEvent.WINDOW_CLOSING) { System.exit(0); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -