云代码会员 - 云代码空间
——
import java.awt.*; |
import java.awt.event.*; |
import javax.swing.*; |
public class Chp13_3 extends JFrame{ |
private JButton denglu,quxiao; |
private JLabel label1,label2; |
private JTextField field1,field2; |
private Container container; |
Chp13_3(){ |
super("登录"); |
container = getContentPane(); |
container.setLayout(new FlowLayout()); |
label1 = new JLabel("账号"); |
field1 = new JTextField(15); |
container.add(label1); |
container.add(field1); |
label2 = new JLabel("密码"); |
field2 = new JTextField(15); |
container.add(label2); |
container.add(field2); |
denglu = new JButton("登录"); |
quxiao = new JButton("取消"); |
container.add(denglu); |
container.add(quxiao); |
setSize(220,200); |
setVisible(true); |
} |