Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Panel added to frame is not showing up

 
Erik Jansen
Greenhorn
Posts: 12
Chrome Notepad Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have made an applet that displays two selection lists. After selecting a value from either of these lists and pressing a button, I'd like to show a different frame (or a panel inside the current frame) with a new interface customized to the selection.

Currently I have a class selectionPanel which looks something like this:


In my main class I call this method after pressing the button as follows:


The newly added panel is not showing up in my main frame. I've tried calling pack() or validate() (suggested in other posts) but this doesn't seem to solve the problem. Do you guys (and possibly girls) have any ideas?
 
Darryl Burke
Bartender
Posts: 5149
11
Java Netbeans IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It rather looks like you need to use a CardLayout.
 
Erik Jansen
Greenhorn
Posts: 12
Chrome Notepad Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I'll have a look!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic