posted 15 years ago
Hi,
I trying to develop a small swing application,
I have two frames one frame is loggin screen and the 2nd frame is a simple frame with contain a form
The login frame will have an "Ok" button and once the "Ok" button is clicked, I want my 2nd frame (which is form) to display.
I have written that piece of code, but want to make sure i do it correctly
Name of frames
1)Login Frame
2)UserConnectedFrameSuccess
This is the Action code of the Ok button present in Login Frame
*******************************************
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
System.out.println("Ok Button Pressed");
setVisible(false);
UserConnectedFrameSuccess ucf = new UserConnectedFrameSuccess();
ucf.setVisible(true);
**********************************************************************
My concerns are
1) if one user passes the login screen is it advisable to completly close it or to hide it. Here is have hidden it becoz i did not know how to close the login fram and display the other frame.
I hope i have explained it nicely. Any help would be appreciated