Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JList question

 
Nate Hur
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2583
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cross posted and rude to a moderator on the other forum
http://www.java-forums.org/awt-swing/35583-dynamic-jlist.html
 
Maneesh Godbole
Saloon Keeper
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
Darryl Burke
Bartender
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The cross post on the other forum has since been deleted.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic