public void actionPerformed(ActionEvent arg0) { new GUI();//next frame dispose(); }
or frame1.setVisible(false); can help u.
loginButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(//check if the admin and password are corect){ frameToClose.dispose();//dispose previous frame //create the other frame or set its setVisible()method to true }else{ //display error message //something like incorrect user or password } } });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)