Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JList : how to add one simple element to a existing list??

 
Manuel Jordan
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys

after to hate google


exists a way to avoid the "for" iteration? , i cant find a way to do that


if i init my swing with a Jlist with already 5 elements and then i press a JButton and the event is executed, the code before shown must be executed and work

but if i have a list with 50 elements, so "for" iteration is not a good approach to acomplish this

pls
help

thanks for advanced
(i use jdk 1.5_09)
 
Justin Chu
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Initialize the default model and keep a reference to it.

 
Manuel Jordan
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks so much

jus wondered by use an extra element listModel

thanks again
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!