Keep a List of the dependent frames in your base frame. When closing one of the dependents, call a method on the base to dispose of all dependents.
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
1) not possible, without huge code for AWT workaround
2) you are talking about JFrame#setDefaultCloseOperations(JFrame.EXIT_ON_CLOSE) with 3 JDialogs##setDefaultCloseOperations(JDilaog.DISPOSE_ON_CLOSE)
3) don't do it that this way its so hard job manage anything betweens four hight level container, you have to put there some hierarchy, result is JFrame as parent with three JDialogs which have got a parent
4) very carrefully with top-level containers , don't create lots of these Object, because they are still in the memory untill current JVM instance exists , you can only to remove its contents and dispose Graphics/Graphics2D
5) look at WindowListener , then you can create own class that manageing lifecycle for all of four Top-Level Containers separatelly or altogether, up to you,
mKorbel
Veteran Poster
1,141 posts since Feb 2011
Reputation Points: 480
Solved Threads: 224