I have multiple jcomboboxes spread throughout my program. Most of these boxes get their data from names or text strings found in databases. Normally when adding a new item, it is added to the bottom of this list.
What I want to do is when I add an element to the combo box is, to insert the element in its sorted alphanumeric order, or insert it at the bottom then move up the list to its appropriate position.... i.e. do an insertion sort one item at a time with an end result of sorted combo box (ascending order).
A typical example of adding an item currently:
while (rs.next()) {
String name = rs.getString("ITEM_NAME");
jComboBox2.addItem(name);
}
Need the code added before the closing brace } and not be a function call.
dont need anything fancy just something short and simple due to the number of combo boxes involved.
Thanks..... my brain is frying, and no eggs to serve them with. lol