?? dialog1.java~14~
字號(hào):
package dialog;import java.awt.*;import java.awt.event.*;import com.borland.jbcl.layout.*;/** * Title: * Description: * Copyright: Copyright (c) 2001 * Company: * @author * @version 1.0 */public class Dialog1 extends Dialog { Panel panel1 = new Panel(); Label label1 = new Label(); Button button1 = new Button(); Button button2 = new Button(); XYLayout xYLayout1 = new XYLayout(); public Dialog1(Frame frame, String title, boolean modal) { super(frame, title, modal); enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); add(panel1); pack(); } catch(Exception ex) { ex.printStackTrace(); } } public Dialog1(Frame frame) { this(frame, "", false); } public Dialog1(Frame frame, boolean modal) { this(frame, "", modal); } public Dialog1(Frame frame, String title) { this(frame, title, false); } void jbInit() throws Exception { label1.setText("這是一個(gè)對(duì)話框"); panel1.setLayout(xYLayout1); button1.setLabel("確定"); button1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { button_actionPerformed(e); } }); button2.setLabel("取消"); button2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { button_actionPerformed(e); } }); panel1.add(label1, new XYConstraints(31, 0, 99, 24)); panel1.add(button1, new XYConstraints(6, 37, 61, 31)); panel1.add(button2, new XYConstraints(102, 37, 62, 32)); } protected void processWindowEvent(WindowEvent e) { if (e.getID() == WindowEvent.WINDOW_CLOSING) { cancel(); } super.processWindowEvent(e); } void cancel() { dispose(); } void button_actionPerformed(ActionEvent e) { dispose(); }}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -