Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I add JPanel to an existing JPanel?

 
Barry Brashear
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a class that is a JPanel. I'd like to add a smaller beveled border
JPamel within that. How do I do that?

Thanks
 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The same as you would add any component to your JPanel.

JPanel panel1 = new JPanel();
JPanel panel2 = new JPanel();

...

panel1.add(panel2);

Cheers,
Rachel
 
Pat Hays
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try JFrameBuilder
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic