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

sort the components of a JComboBox

 
aude tantot
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the application I'm writing, Iuse an editable ComboBox, and I would like to sort the combo list each time the user add an element, without deleting a component.
thanks for ur help :-*
 
Aleksey Matiychenko
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you need is to add/delete components through a model not a combobox directly.
You can write your own model to use a Vector or ArrayList and then use Collections.sort method to sort your data.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!