public class DialogDeom extends JFrame{
public static void main(String args[]){
DialogDeom a=new DialogDeom("");
JDialog h=new JDialog(a,"马天宇",true);
JLabel b=new JLabel("请输入值");
JLabel c=new JLabel("请输入密码");
JTextField d=new JTextField(25);
JPasswordField e=new JPasswordField(25);
JButton f=new JButton("确定");
JButton g=new JButton("取消");
h.setSize(500,200);
h.setLayout(null);
h.add(b);
h.add(c);
b.setBounds(20, 30, 140, 20);
c.setBounds(20, 60, 140, 20);
h.add(d);
h.add(e);
d.setBounds(160, 30, 150, 20);
e.setBounds(160, 60, 150, 20);
h.add(f);
h.add(g);
f.setBounds(60, 100, 80, 25);
g.setBounds(170,100 , 80, 25);
h.setVisible(true);
a.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
private DialogDeom(String str) {
super(str);
this.setSize(500,600);
Container z=this.getContentPane();
z.setLayout(new FlowLayout());
Icon icon=new ImageIcon("D:/My Documents/美图图库/j_副本.JPG");
JLabel v=new JLabel("yuxiangsui",icon,SwingConstants.RIGHT);
z.add(v);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
public static void main(String args[]){
DialogDeom a=new DialogDeom("");
JDialog h=new JDialog(a,"马天宇",true);
JLabel b=new JLabel("请输入值");
JLabel c=new JLabel("请输入密码");
JTextField d=new JTextField(25);
JPasswordField e=new JPasswordField(25);
JButton f=new JButton("确定");
JButton g=new JButton("取消");
h.setSize(500,200);
h.setLayout(null);
h.add(b);
h.add(c);
b.setBounds(20, 30, 140, 20);
c.setBounds(20, 60, 140, 20);
h.add(d);
h.add(e);
d.setBounds(160, 30, 150, 20);
e.setBounds(160, 60, 150, 20);
h.add(f);
h.add(g);
f.setBounds(60, 100, 80, 25);
g.setBounds(170,100 , 80, 25);
h.setVisible(true);
a.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
private DialogDeom(String str) {
super(str);
this.setSize(500,600);
Container z=this.getContentPane();
z.setLayout(new FlowLayout());
Icon icon=new ImageIcon("D:/My Documents/美图图库/j_副本.JPG");
JLabel v=new JLabel("yuxiangsui",icon,SwingConstants.RIGHT);
z.add(v);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
