This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JList Refresh 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 Refresh" Watch "JList Refresh" New topic
Author

JList Refresh

Pavan Kumar
Greenhorn

Joined: Jan 13, 2002
Posts: 8
Hi all,

I need to add item from one Jlist to other Jlist, when I click a add button, the item which is added to Jlist should be visibble. Please let me know how to do coding.

Hari.


pavan kuamr
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
from #1 JList you use getSelectedValue()
add this to #2 JList's listModel

to have this item showing, use this method
list2.ensureIndexIsVisible(listModel.size()-1)
(assuming you want it added to the end of #2)
 
Have you checked out Aspose?
 
subject: JList Refresh
 
It's not a secret anymore!