39 lines
905 B
Java
39 lines
905 B
Java
package exp7;
|
|
|
|
import java.awt.*;
|
|
|
|
import javax.swing.JButton;
|
|
import javax.swing.JFrame;
|
|
import javax.swing.JLabel;
|
|
import javax.swing.JTextField;
|
|
|
|
|
|
public class QQLongin {
|
|
public static void main(String[] args) {
|
|
JFrame f = new JFrame("QQ登录");
|
|
f.setDefaultCloseOperation(3);
|
|
f.setSize(600, 400);
|
|
f.setLocationRelativeTo(null);
|
|
f.setLayout(new GridBagLayout());
|
|
|
|
JLabel idText = new JLabel("账号");
|
|
f.add(idText);
|
|
|
|
JTextField idField = new JTextField();
|
|
f.add(idField);
|
|
|
|
JLabel pwdText = new JLabel("密码");
|
|
f.add(pwdText);
|
|
|
|
JTextField pwdField = new JTextField();
|
|
f.add(pwdField);
|
|
|
|
JButton loginButton = new JButton("登录");
|
|
JButton registerButton = new JButton("注册");
|
|
f.add(loginButton);
|
|
f.add(registerButton);
|
|
|
|
f.setVisible(true);
|
|
}
|
|
}
|