/** * Sets the currently selected item. * * <p>The selection notification process is very much a hack. This fires * a ListDataEvent where the range is between -1 and -1. This is identical * to the notification process used by the {@link DefaultComboBoxModel}. */ public void setSelectedItem(Object selected) { // if the selected item isn't actually changing values, avoid the work if (this.selected == selected) return; this.selected = selected; listDataEvent.setRange(-1, -1); listDataEvent.setType(ListDataEvent.CONTENTS_CHANGED); fireListDataEvent(listDataEvent); } }
/** * Sets the currently selected item. * * <p>The selection notification process is very much a hack. This fires * a ListDataEvent where the range is between -1 and -1. This is identical * to the notification process used by the {@link DefaultComboBoxModel}. */ public void setSelectedItem(Object selected) { // if the selected item isn't actually changing values, avoid the work if (this.selected == selected) return; this.selected = selected; listDataEvent.setRange(-1, -1); listDataEvent.setType(ListDataEvent.CONTENTS_CHANGED); fireListDataEvent(listDataEvent); } }
/** * Sets the currently selected item. * * <p>The selection notification process is very much a hack. This fires * a ListDataEvent where the range is between -1 and -1. This is identical * to the notification process used by the {@link DefaultComboBoxModel}. */ @Override public void setSelectedItem(Object selected) { // if the selected item isn't actually changing values, avoid the work if (this.selected == selected) return; this.selected = selected; listDataEvent.setRange(-1, -1); listDataEvent.setType(ListDataEvent.CONTENTS_CHANGED); fireListDataEvent(listDataEvent); } }