buttonframe.java~6~
来自「jbuilder2006一书的所有源代码」· JAVA~6~ 代码 · 共 36 行
JAVA~6~
36 行
package control;import java.awt.*;import java.awt.event.*;import javax.swing.*;public class ButtonFrame extends JFrame { JPanel contentPane; JButton jButton1 = new JButton(); public ButtonFrame() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { contentPane = (JPanel) this.getContentPane(); jButton1.setBounds(new Rectangle(116, 114, 151, 37)); jButton1.setText("按钮示例"); contentPane.setLayout(null); this.setSize(new Dimension(400, 300)); this.setTitle("Button示例"); contentPane.add(jButton1, null); } protected void processWindowEvent(WindowEvent e) { if (e.getID() == WindowEvent.WINDOW_CLOSING) { System.exit(0); } }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?