frame1.java~4~
来自「是用java实现的一些按钮」· JAVA~4~ 代码 · 共 40 行
JAVA~4~
40 行
package untitled1;import java.awt.*;import java.awt.event.*;import javax.swing.*;import com.borland.jbcl.layout.*;public class Frame1 extends JFrame { JPanel contentPane; JScrollPane jScrollPane1 = new JScrollPane(); JTree jTree1 = new JTree(); //Construct the frame public Frame1() { enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { contentPane = (JPanel) this.getContentPane(); contentPane.setLayout(null); this.setSize(new Dimension(400, 300)); this.setTitle("Frame Title"); jScrollPane1.setBounds(new Rectangle(0, 0, 4, 4)); contentPane.add(jScrollPane1, null); jScrollPane1.getViewport().add(jTree1, null); } //Overridden so we can exit when window is closed protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { System.exit(0); } }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?