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

Hide Jframes  RSS feed

 
kaut raut
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi if we have one jframe and two-three Jpanels and we need to hide them and show another Jframe, then we need to hide jframe or jpanels ?
 
Tony Docherty
Bartender
Posts: 3264
81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming the JFrame in question holds the JPanels you mention then you just need to hide the JFrame and the JPanels will be hidden as a consequence.
 
Campbell Ritchie
Sheriff
Posts: 55333
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you want to hide a frame? You can simply minimise it (but Swing calls that iconifying).
 
Rob Camick
Ranch Hand
Posts: 2787
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally an application should only have a single JFrame so I don't know why you want to hide it.

You may have child dialogs that display to gather/display information.

Or you can use a CardLayout to swap panels in a JFrame.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!