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

Bug with Swing?

 
Matt Ghiold
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,
I built a frame and set it's layout to be a borderLayout.
Then, I built a JPanel and set it's layout to CardLayout.
Now, I add a JPanel to my CardLayout that contains some combo boxes, and the combo boxes
do not look or behave correctly. If I take that same panel with the combo boxes and place it directly in the mainFrame in the center, it behaves just fine.
Any thoughts on how I can fix this or what is going on?
Thanks in advance
-Matt
 
David Li
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matt,
I think you should invoke some method of the CardLayout to show a specific card.
For example:
cardLayout.first(cardPanel);
or:
cardLayout.show(cardPanel, "yourSecondPanelName");
Hope this helps,
David
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic