Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JList

Reply
Thread Tools

JList

 
 
Anitha Namachivayam via JavaKB.com
Guest
Posts: n/a
 
      04-13-2005
Hello,
How to add a single element to the JList at run time?

Thanks,
Sri

--
Message posted via http://www.javakb.com
 
Reply With Quote
 
 
 
 
Arnaud Berger
Guest
Posts: n/a
 
      04-13-2005
Hi,

If the JList was constructed with new JList(new DefaultListModel()),

doing : ((DefaultListModel)jList.getModel()).addElement(so meObject);

should work.

Regards,
Arnaud

"Anitha Namachivayam via JavaKB.com" <(E-Mail Removed)> a écrit dans
le message news: http://www.velocityreviews.com/forums/(E-Mail Removed)...
> Hello,
> How to add a single element to the JList at run time?
>
> Thanks,
> Sri
>
> --
> Message posted via http://www.javakb.com



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting the previously selected index for JList Jared Java 0 07-31-2003 07:39 AM
JList Problems Tom Java 1 07-30-2003 03:15 PM
JList problem. Tom Java 1 07-30-2003 12:53 PM
JList question - how to fire a change event when nothing has changed? Sam Java 0 07-17-2003 10:40 PM
JList question Passero Java 1 06-28-2003 12:17 PM



Advertisments