aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JList Sizing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JList Sizing" Watch "JList Sizing" New topic
Author

JList Sizing

Amy Phillips
Ranch Hand

Joined: Apr 02, 2003
Posts: 280
I have created my screen layout which contains a title panel, t=2 JLists with labels and buttons. At the moment I have the 2 JLists and their labels in 2 BoxLayout Panels which I then place into another BoxLayout Panel to stack them vertically. However my problem is that the JLists are stretching to fill the entire center panel. is there anyway i can position this panel in the center with space on either side?
Also is it possible to create more of a dropdown list rather than a JList?
Thanks
Eddie Vanda
Ranch Hand

Joined: Mar 18, 2003
Posts: 281
You could use borders with insets:
Border border1 = BorderFactory.createEmptyBorder (5,5,5,5);
Border border2 = BorderFactory.createBevelBorder (BevelBorder.LOWERED);
Border border = BorderFactory.createCompoundBorder (border2, border1);
and then use
setBorder on the Box panel.

Check out JComboBox for a drop down list.


The nice thing about Standards is that there are so many to choose from!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JList Sizing