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


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

JList question

Nate Hur
Greenhorn

Joined: Dec 02, 2010
Posts: 2
I have a JList that the user is allowed to add names to. The JList is in a panel that has a boxlayout. I have other components to the right of the JList. The components to the right of the JList are in a separate panel and are also in a boxlayout. The JList is scrollable. When the user enters a name all of the components to the right shift rightward even thought the list stays the same size since it is scrollable. Is there any way I can prevent these components from shifting to the right?
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2095
    
    7
Read the JList API and follow the link to the Swing tutorial on "How to Use Lists" for a working example that update a JList from a value in a text field.

If you need more help then post your SSCCE that demonstrates the problem.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Cross posted and rude to a moderator on the other forum
http://www.java-forums.org/awt-swing/35583-dynamic-jlist.html


luck, db
There are no new questions, but there may be new answers.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9993
    
    7

Thanks Darryl.

Nate,
Please read http://www.coderanch.com/how-to/java/BeForthrightWhenCrossPostingToOtherSites


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

The cross post on the other forum has since been deleted.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JList question
 
Similar Threads
JList Item Not Getting Mouse Clicks
JList Sizing
scrollpane on JPanel
How To Refresh a JDialog?
Need ScrollPane with just VERTICAL Scrolling facility