if(e.getActionCommand().equals("进入"))
{
if(text1.getText().trim().equals(""))
{
JOptionPane.showMessageDialog(null,"用户名不能为空");
return;


   // parent.setVisible(false);
}
else if(text2.getText().trim().equals(""))
{
JOptionPane.showMessageDialog(null,"密码不能为空");
return;
}
else
{
try
{
Connection con1 = DriverManager.getConnection("jdbc:odbc:test","","");
Statement stmt1 = con1.createStatement();
    String strSQL;
    strSQL = "select * from user where id = "+text1.getText().trim()+ "and Password = "+text2.getText().trim();
    ResultSet rs1 = stmt1.executeQuery(strSQL);
    boolean isexit = false;
    isexit = rs1.first();
    if(!isexit)
      {
    JOptionPane.showMessageDialog(null,"用户名或密码错误");
      }else
      {
      new Main();
      System.out.println("OK:");
    parent.setVisible(false);
       }
       con1.close();
 }catch(Exception e2)
   {}
}
}编译没错误,就是输入用户名和密码后,按下按扭没反应,请您指点!