List of utility methods to do JComboBox Selection
boolean | setComboxSelectItem(JComboBox cb, String s) set Combox Select Item int num = cb.getItemCount(); if (s == null || num < 1) return false; String v = (String) cb.getSelectedItem(); if (v.equals(s)) return false; for (int i = 0; i < num; i++) { v = (String) cb.getItemAt(i); ... |
void | setListData(final JComboBox set List Data box.removeAllItems(); if (items != null) { for (E o : items) { box.addItem(o); if (selected != null && !items.contains(selected)) { box.addItem(selected); |
boolean | setSelectedHeadersaveFileTypeItem(JComboBox combo, int fileType) set Selected Headersave File Type Item boolean rv = false; for (String s : headersaveFileTypeItems) { if (!s.isEmpty()) { if (s.charAt(0) == fileType) { combo.setSelectedItem(s); rv = true; break; return rv; |
void | updateContents(@SuppressWarnings("rawtypes") JComboBox box, Object[] options, int selectedIndex) update Contents updateContents(box, options); box.setSelectedIndex(selectedIndex); |