List of usage examples for com.jgoodies.binding.list SelectionInList SelectionInList
public SelectionInList(ValueModel listHolder, ValueModel selectionHolder, ValueModel selectionIndexHolder)
Constraints: 1) The listHolder must hold instances of List or ListModel and 2) must report a value change whenever the value's identity changes.
From source file:cz.vity.freerapid.gui.dialogs.DownloadHistoryDialog.java
private void bindCombobox(final JComboBox combobox, String key, final Object defaultValue, final String[] values) { if (values == null) throw new IllegalArgumentException("List of combobox values cannot be null!!"); final MyPreferencesAdapter adapter = new MyPreferencesAdapter(key, defaultValue); final SelectionInList<String> inList = new SelectionInList<String>(values, new ValueHolder(values[(Integer) adapter.getValue()]), adapter); Bindings.bind(combobox, inList); }