• Post Reply Bookmark Topic Watch Topic
  • New Topic

Possible without layouts?

 
Nicholas George
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm guessing the problem here has to do with layouts in some way or other, but when I add two JPanels to a JFrame, only the second one stays there. What makes me think it's not just a layout thing is that if I call getComponentCount, I'm told there's just one. The code:



Seems only sensible that the two should appear next to eachother...

They appear in their proper places individually, but never together
[ June 05, 2008: Message edited by: Nicholas George ]
 
Campbell Ritchie
Marshal
Posts: 52516
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What layout are you using? Remember that JFrame defaults to Border, so you have to specify different locations for your two panels.

If you really have two, side by side, try GridLayout with 1 row and 2 columns.
 
Nicholas George
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah, that did it. Good God, swing tries WAAAY to hard to be helpful with layouts...

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