I'm new to Java but I come from a C# background (Also a beginner there as well).
I've made a simple MDI app in java. My app starts off displaying a single child frame (The Main Menu) which has lots of buttons. I wish to open new child frames by pressing these buttons.
Initally, I had this in the action performed for the respect button:
While the above 2 lines worked, the dispose method of the first form would take focus of the screen (Meaning the user would have to do an inital click on the new form to gain focus).
Now, I swapped the 2 lines of code around:
and everything seems to work OK, however is this "the correct way" to go about things? Will the Garbage collector free the memory that the first form was taking up? (Hopefully it will!)
Thanks for the help