Tentei mas o setText, setForeground ficam com erro can not find the symbol), quando feitos no Dao:
public void fRMLogin(Object jTextField_Username, Object jPasswordField_Password, Object jLabel_Message){
Connection con = ConnectionFactory.getConnnection();
PreparedStatement pst = null;
ResultSet rs =null;
String sql = "SELECT login, senha FROM tbl_login WHERE login=? AND senha=? ";
try {
pst=con.prepareStatement(sql);
pst.setString(1, jTextField_Username.getText());
pst.setString(2, String.valueOf(jPasswordField_Password.getPassword()));
rs = pst.executeQuery();
if(rs.next()){
JOptionPane.showMessageDialog(null,"username and password matched");
jLabel_Message.setText("Login Successfully");
jLabel_Message.setForeground(Color.GREEN);
//timer1.start();
new MenuView().setVisible(true);
}else{
JOptionPane.showMessageDialog(null, "username and password do not matched");
jLabel_Message.setText("Invalide Username Or Password !!");
jLabel_Message.setForeground(Color.RED);
//timer1.start();
}
} catch (Exception ex) {
JOptionPane.showMessageDialog(null,ex);
}
}
Isso ta errado, você não tem que receber um textfield como parametro e sim uma String que vai ser o usuario e senha (você até pode, mas não seria a maneira mais correta, além do que, o seu parametro é Object e no método vc vai ter que converter para jTextField para pegar o valor
public void fRMLogin(String username, String password){
...
}