• Post Reply Bookmark Topic Watch Topic
  • New Topic

Completely delete a frame without deleting the application  RSS feed

 
Yoshihiro Shimatsu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two frames, GUI gui and GUI2 gui2. I can invoke the dispose method to delete gui2 by clicking a button on gui. But when I click the Start button on gui to create a new instance of gui2, gui2 still displays the animation before deletion. This is because:

dispose

public void dispose()

The Window and its subcomponents can be made displayable again by rebuilding the native resources with a subsequent call to pack or show. The states of the recreated Window and its subcomponents will be identical to the states of these objects at the point where the Window was disposed (not accounting for additional modifications between those actions).


How can I completely delete the gui2 object and, once Start button clicked, the gui2 can show the animation from the start?
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stop the animation and reset it to its initial state as part of the closing of its parent window. Then dispose should give satisfactory results.

Another option is to (also) set the reference to its parent window to null.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!