• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to make components stick togather  RSS feed

 
Tarun Bolla
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I have small problem with swing BoxLayout. I am laying out JPanels in a vertically aligned Box Layout and they are just floating around. Please see the attachment for detail. I want them to stick together even though there is extra space in the bottom...Any suggestions??

Thank You,
Tarun B.
floating-panels.JPG
[Thumbnail for floating-panels.JPG]
Floating panels with BoxLayout Vertical align
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use an appropriate layout or combination of layouts, nested. Or add a Glue (see the API for Box) after the last component (haven't tested this).

Read all (well, not really all ...) about layouts here.
 
Tarun Bolla
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl Burke wrote:Use an appropriate layout or combination of layouts, nested

Thank you, Darryl Bruke..I used the nested layout .. a BoxLayout inside BorderLayout north. It worked...
Thank you
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!