Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

JList question

 
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?
 
Rancher
Posts: 3190
29
  • 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.
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • 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
 
Darryl Burke
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The cross post on the other forum has since been deleted.
 
I am not a spy. Definitely. Definitely not a spy. Not me. No way. But this tiny ad ...
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic