How come the main frame does'nt appear though the username and pw s correct
Here is a line from my program...I compiled ant run it successfully...but the main frame(Arch Main) does'nt seem to appea...only the JOptionPane message dialog....
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try{
MyDBConnection jdbc = new MyDBConnection();
jdbc.init();
Connection conn = jdbc.getMyConnection();
Statement stmt = conn.createStatement();
System.out.println(jTextField1.getText());
System.out.println(jPasswordField1.getPassword());
stmt.execute("select * from account where user='" + jTextField1.getText() + "' and password='" + jPasswordField1.getPassword() + "'");
ResultSet rs = stmt.getResultSet();
//this line does'nt seem to work...
if(rs.next()) {
ArchMain a = new ArchMain();
a.setVisible(true);
this.setVisible(false);
} else {
JOptionPane.showMessageDialog(null,"Invalid user or password","ERROR",JOptionPane.ERROR_MESSAGE);
}
}catch(Exception ex) {
ex.printStackTrace();
}
}
--

