当前位置: 技术问答>java相关
如何制作对话框!如:dialog box
来源: 互联网 发布时间:2015-02-01
本文导语: | Dialog dl = new Dialog(window, "Change Title", true); dl.setLayout(new FlowLayout(FlowLayout.CENTER)); TextField tf = new TextField(window.getTitle(), 25); dl.add(tf); dl.add(new Button("OK")); dl.resize(200,75); dl.show(); | 看看JOptionPane类 ...
|
Dialog dl = new Dialog(window, "Change Title", true);
dl.setLayout(new FlowLayout(FlowLayout.CENTER));
TextField tf = new TextField(window.getTitle(), 25);
dl.add(tf);
dl.add(new Button("OK"));
dl.resize(200,75);
dl.show();
dl.setLayout(new FlowLayout(FlowLayout.CENTER));
TextField tf = new TextField(window.getTitle(), 25);
dl.add(tf);
dl.add(new Button("OK"));
dl.resize(200,75);
dl.show();
|
看看JOptionPane类
如
Button b = new Button("OK");
JOptionPane.showMessageDialog(b,"title");
如
Button b = new Button("OK");
JOptionPane.showMessageDialog(b,"title");