我做了个登陆界面   无论怎样都不能实现  Netbeans也不报错~~~我很无奈  求大神解惑
代码如下
    private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {                                         
    if(evt.getSource()==okButton)
        {
            Name=name.getText();
            Pwd=pwd.getText();
            try{
            Class.forName("com.mysql.jdbc.Driver");
            String url="jdbc:mysql://localhost:3306/user?user=root&password=900511";
            Connection conn= DriverManager.getConnection(url);
            Statement stmt=conn.createStatement();
            String sql = "select * from users where name='" + Name+ "' and pwd = '" + Pwd + "'";
            ResultSet rs=stmt.executeQuery(sql);
            if(rs.next())
            {
               JFrame main = Lib20App.getApplication().getMainFrame();
               main.dispose();
               UserWnd userwnd=new UserWnd();
               userwnd.setVisible(true);
            }
        else
             {
               JOptionPane.showMessageDialog(null,"密码错误!!");
               System.exit(0);
              }
    }catch(Exception e)
   {}// TODO add your handling code here:
    }                                        
    }
这是确认按钮部分的代码

解决方案 »

  1.   

    程序执行了   输入账号密码 按下确认按钮后   登陆窗口没有消失   新的窗口即UserWnd窗口没有出现   
      

  2.   

    没有异常的原因是你的
    catch(Exception e)
    {}// TODO add your handling code here:
    啥也没做,改成catch(Exception e){e.printStackTrace();}试试
      

  3.   

    catch(Exception e){}
    不要写这样的代码。
    你可以这么写:
    catch(Exception e){
    e.printStackTrace(System.err);
    }
      

  4.   

    好的    有异常了    java.lang.ClassNotFoundException   进一步求指教~~~
      

  5.   

    ClassNotFoundException 没找到类
    你把jdbc驱动包包含进来没