• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding elements in a JList

 
AbhiKool Jain
Greenhorn
Posts: 7
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an String Array which updates itself in the later part of the program. How can I add elements in an existing JList by passing the String Array or a single element of it whenever the array gets updated??
I didn't know how model thing works on JList and JavaDoc API don't have any addElement() method for a JList. (Don't know why don't Sun just put an addElement() or add() method)
 
Paul Clapham
Sheriff
Posts: 21588
33
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then you should have a look at the tutorial: How to Use Lists. It has an example of how to create a JList which can accept new entries.
 
AbhiKool Jain
Greenhorn
Posts: 7
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, understood what I was missing
Java Rockzzz...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic