Originally posted by con lu:
Scenario:-
1)Have a JDesktopPane
2)Add 2 JInternalFrames to the JDesktopPane
3)Add the JDesktopPane to the ContentPane
After closing a JInternalFrame you can only reuse it by adding it to a container again, even if you never removed it from the container (refer API notes)" Typically this will be the JDesktopPane that previously held the JInternalFrame
Given the scenario above do I have to add the closed JInternalFrame to the JDesktopPane ?
Do I also have to add the JDesktopPane to the ContentPane again? If so, what happens to the other JInternalFrame in the JDesktopPane that wasn't closed?
Any help much appreciated!
The best solution to this problem which immediately comes to mind is to change the close behavior of your internal frames to HIDE_ON_CLOSE. See the method JInternalFrame.setDefaultCloseBehavior.