I want to know that when we click a button how can we a get a new GUI components arrange in different manner than the previous one or
it is just like a back & forward option in games
I want to know that when we click a button how can we a get a new GUI components arrange in different manner than the previous one or
it is just like a back & forward option in games
just disable the current GUI settings, and call the new set of components...
For example, before the game starts, prompt for name,
that GUI may have textfield, label, button or etc,
If satisfied, disable those components, set them into invisible, and call the new set of components...
Set the new components into visible....
If i were to implement that, i will initialize all the components...
but i will set them all into invisible...and what the player likes to choose an option, then set them in visible(depends on you)...
If those previous components are no longer to be used, set those objects to null then call the java garbage collector...
ThankYou for your reply ..
but may I know what is java garbage collector & how to call it????????
For your first question, read about actionPerformed and the rePaint() method.
You don't need to call the garbage collector in Java. Garbage collection is automatic. You can suggest that the OS do the garbage collection using System.gc but I don't think you want to do that.
if you are talking about JFrames when you want to show another frame by using the visible function put the parameter "false" and for the new frame put the parameter in the visible function as true (you don't need to go and play with the old frame just do the second step and it will work)_
Comment