This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 2152
    
    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: 10167
    
    8

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
Need ScrollPane with just VERTICAL Scrolling facility
How To Refresh a JDialog?
JList Sizing
JList Item Not Getting Mouse Clicks
scrollpane on JPanel