It's not a secret anymore!
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
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JList question" Watch "JList question" New topic

JList question

Nate Hur

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: 2450
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

Joined: May 03, 2008
Posts: 5115

Cross posted and rude to a moderator on the other forum

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

Joined: Jul 26, 2007
Posts: 10824

Thanks Darryl.

Please read

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

Joined: May 03, 2008
Posts: 5115

The cross post on the other forum has since been deleted.
I agree. Here's the link:
subject: JList question
It's not a secret anymore!