import java.sql.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.*;
//定义一个主界面的类
public class zhujiemian {
JFrame JJ=new JFrame();
JPanel JP=new JPanel();
JTextField user, password;
public void zong() {
JJ.setVisible(true);
JJ.add(JP);
JJ.setTitle("QQ登录程序");
JJ.setSize(500,300);
JJ.setLocation(200,100);
}
public void denglu() {
JP.setLayout(null);
JButton JB1=new JButton("登录");
JButton JB2=new JButton("退出");
JB1.setBounds(100,150,90,28);
JB2.setBounds(300,150,90,28);
JP.add(JB1);
JP.add(JB2);
JB1.addMouseListener(new JB1Listener());
JB2.addMouseListener(new JB2Listener());
}
class JB1Listener implements MouseListener {
JFrame JF=new JFrame();
JPanel JP=new JPanel();
public void mouseReleased(MouseEvent e) {
int i;
shujuku(); //链接数据库
i=validate();//测试是否相等
//if (JT1.getText().equals("name")&&JT2.getText().equals("pw"))
JF.setVisible(true);
JF.setTitle("QQ登录程序");
JF.setSize(200,400);
JF.setLocation(1150,30);
JJ.setVisible(false);
JF.add(JP);
JP.setLayout(null);
JButton jb1=new JButton("空间 ");
jb1.setBounds(80,60,30,28);
JP.add(jb1);
JButton jb2=new JButton("微博 ");
jb2.setBounds(130,60,30,28);
JP.add(jb2);
JLabel jb=new JLabel("未央不见");
jb.setBounds(90,0,70,70);
JP.add(jb);
}
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
}
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
}
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}