Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Rebuilding a Container  RSS feed

 
Rick Gentry
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got a JMenuBar filled with JMenuItems and I need all of them to be able to change the GUI. i.e. File->New brings up a different combination of textfields and buttons than File->Open. How do I go about doing that? Everything I've tried doing has left the frame blank.
 
Joe Ess
Bartender
Posts: 9426
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Invoking invalidate() on a container should cause it to be laid out and drawn again. Perhaps you should look into using a CardLayout to switch between the two layouts.
 
Rick Gentry
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot, that helped.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the Swing forum.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!