Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JPanel Border

Status
Not open for further replies.

fatcodeguy

Programmer
Feb 25, 2002
281
CA
Hi, I have a JPanel (jp1) with a titled border that I'm adding to another JPanel (jp2). Within jp1 there are text areas that change values, so jp1 keeps expanding and contracting depending on the values... I want the panel (or at least the border) to stay at a fixed size... I'm using gridbag layout for both panels. Any suggestions?

Thanks
 
It depends on the layout of the container(jp2) which contains jp1. I am assuming you are using GridBagLayout for jp1. What layout are you using for jp2? if you have nothing else in jp2 I would recommend a BorderLayout, and constrain jp1 to the CENTER. If you are using something else because you have some other components with jp2 in it's container, please let me know what layout it has. Better yet post the code for it, or some simplified sample code that mimics your code with the issue.

Let me know...

Rodney
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top