• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reopening closed JInternalFrames

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic