Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moving from one JFrame to another

In a package in Netbeans I created two JFrame Forms, first one is Login, second is, mainProgram, after the successful log in, I use the following way to "close" the Login frame and open the main program frame.

mainProgram m=new mainProgram();
m.setVisible(true);
setVisible(false); //to hide the log in frame

Is this the correct way? Isn't it wrong if these two separated classes are hidden instead of being closed? are these one process or two different processes? if there's a better way then what is it?

thanks..

like image 301
Ali Bassam Avatar asked Dec 26 '22 22:12

Ali Bassam


1 Answers

Is this the correct way?

Yes, this should be fine.

isn't it wrong if these 2 separated classes are hidden instead of being closed?

The ideal is dispose of your unused forms (such as the login form when not needed any more)

are these 1 process or 2 different processes?

These will run on the same process

like image 119
GETah Avatar answered Jan 09 '23 22:01

GETah