frame1.java~4~

来自「Jbuilder100个例子 都是经典例子 对大家学习Jbuilder非常有帮助」· JAVA~4~ 代码 · 共 44 行

JAVA~4~
44
字号
package dialog;import java.awt.*;import java.awt.event.*;import javax.swing.*;import com.borland.jbcl.layout.*;public class Frame1 extends JFrame {  JPanel contentPane;  Button button1 = new Button();  VerticalFlowLayout verticalFlowLayout1 = new VerticalFlowLayout();  Button button2 = new Button();  /**Construct the frame*/  public Frame1() {    enableEvents(AWTEvent.WINDOW_EVENT_MASK);    try {      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  /**Component initialization*/  private void jbInit() throws Exception  {    //setIconImage(Toolkit.getDefaultToolkit().createImage(Frame1.class.getResource("[Your Icon]")));    contentPane = (JPanel) this.getContentPane();    button1.setLabel("显示模态对话框");    contentPane.setLayout(verticalFlowLayout1);    this.setResizable(false);    this.setSize(new Dimension(211, 85));    this.setTitle("Dialog演示程序");    button2.setLabel("显示非模态对话框");    contentPane.add(button1, null);    contentPane.add(button2, 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 + -
显示快捷键?