• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reinitialising a JInternalFrame  RSS feed

 
Michael Labuschagne
Ranch Hand
Posts: 56
Java Tomcat Server Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
final JInternalFrame taskSelectionFrameHeader = new JInternalFrame("Task Selection Screen", true, false, true, true);

I need to reuse the internal frame after using removeAll()...

How do I get it back to a point where I can put object back on it as if it was in a newly instantiated state?

Thanks
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sounds like all you need to do is add objects the same way as when first initialized,
but because the component is already visible, you would need to call
internalFrame.revalidate();
after adding the new objects.
 
Michael Labuschagne
Ranch Hand
Posts: 56
Java Tomcat Server Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK that makes sense but my problem more lies in the fact that when I invoke a removeAll() even the window bar / minimize etc... buttons disappear... How do I get the frame back to it's normal state as if it had jst been instantiated.

JInternalFrame have a bar across the top of the window and minimize, maximize and close options...
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ah yes, forgot about internalFrame's northPane which would get the flick in a removeAll()

something like this (perhaps?) might suit

 
Michael Labuschagne
Ranch Hand
Posts: 56
Java Tomcat Server Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the trouble michael.... it's appreciated... thinking bout it now I could've jst looked at the code in JInternalFrames constructor...

Thanks a lot!!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!