import java.io.*;
import javax.swing.*;
import java.sql.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
class guiClass implements ActionListener
{
JButton queding;
JButton quxiao;
JLabel yonghuming;
JLabel mima;
JTextField JT1;
JPasswordField JT2;
public void init()
{
JFrame f=new JFrame("用户登录");
JPanel j1=new JPanel();
JPanel j2=new JPanel();
JPanel j3=new JPanel();
FlowLayout flow=new FlowLayout();
j1.setLayout(flow);
j2.setLayout(flow);
j3.setLayout(flow);
f.getContentPane().setLayout(new BorderLayout());
yonghuming=new JLabel("用户名:");
mima=new JLabel("密码 :");
JT1=new JTextField(12);
JT2=new JPasswordField(12);
JT2.setEchoChar('*');
queding=new JButton("确认");
quxiao=new JButton("取消");
j1.add(yonghuming);
j1.add(JT1);
j2.add(mima);
j2.add(JT2);
j3.add(queding);
j3.add(quxiao);
f.getContentPane().add("North",j1);
f.getContentPane().add("Center",j2);
f.getContentPane().add("South",j3);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(300, 150);
f.setVisible(true);
queding.addActionListener(this);
quxiao.addActionListener(this);
JT1.addActionListener(this);
JT2.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==quxiao)
{
System.exit(0);
}
if(e.getSource()==queding)
{
int num=3;
JTextField JT1=(JTextField)e.getSource();
JPasswordField JT2=(JPasswordField)e.getSource();
if(tools.eqes(JT1.getText(), JT2.getText()))
{
JOptionPane.showMessageDialog(this,"欢迎进入系统~");
System.exit(0);
}
else
{
--num;
if(num==0)
{
JOptionPane.showMessageDialog(this,"用户名或者密码错误!您没有机会了");
System.exit(0);
}
else
{
JOptionPane.showMessageDialog(this,"用户名或者密码错误!您还有"+num+"次机会");
}
}
}
else
{
JOptionPane.showMessageDialog(this,"输入有误~!");
}
}
}
public class test
{
public static void main(String[] s)
{
guiClass g = new guiClass();
g.init();
}}
编译错误 望给与解答