This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reopening closed JInternalFrames

 
Con Lu
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Mike Dahmus
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic