I want to replace the current panel and call another panel in JPanel forms.
I try to do using setContentPane() and getContentPane() method but it gives error.
how can I do that....
I also try this but clear all the componens but do not add anything
private void loginButtonActionPerformed(java.awt.event.ActionEvent evt) {
try {
if (new ConnectionFactory().userLoginCheck(usernameText.getText(), new String(passwordText.getPassword()))) {
removeAll();
add(new ChangeUsernamePassword());
revalidate();
repaint();
//new Welcomeboard();
} else {
warningLabel.setText("Invalid Username Or Password!!!");
}
} catch (ClassNotFoundException ex) {
Logger.getLogger(DashboardPanel.class.getName()).log(Level.SEVERE, null, ex);
} catch (SQLException ex) {
Logger.getLogger(DashboardPanel.class.getName()).log(Level.SEVERE, null, ex);
}
}