packagecom.szp.login;importjavax.swing.*;importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjava.net.*;publicclassLoginextendsJFrame{publicJTextFi...
package com.szp.login;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.*;
public class Login extends JFrame {
public JTextField acc = new JTextField();
public JPasswordField pwd = new JPasswordField();
public JPanel pnuser;
public JButton login = new JButton("登陆");
public JButton regist = new JButton("注册");
public JLabel useraccount = new JLabel("账户");
public JLabel userpassword = new JLabel("密码");
public Login(){
this.setTitle("登陆即时通");
this.setSize(300,200);
this.setResizable(false);
this.pnuser.setLayout(null);
this.useraccount.setBounds(50, 55, 60, 20);
this.userpassword.setBounds(50, 85, 60, 25);
this.acc.setBounds(110, 55, 120, 20);
this.pwd.setBounds(110, 85, 120, 20);
this.login.setBounds(85, 120, 60, 20);
this.login.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
//login_ActionEvent(e);
}
});
this.regist.setBounds(155, 120, 60, 20);
this.regist.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
//regist_ActionEvent(e);
}
});
this.pnuser.add(useraccount);
this.pnuser.add(userpassword);
this.pnuser.add(acc);
this.pnuser.add(pwd);
this.pnuser.add(login);
this.pnuser.add(regist);
this.add(pnuser);
this.setVisible(true);
}
public static void main(String[] args){
Login login = new Login();
}
}
展开