@Override public void setSelected(boolean selected) { this.selected = selected; for (ComponentListener listener : getListeners()) { if (listener instanceof SelectableComponentListener) { try { ((SelectableComponentListener) listener).onSelectedStateChanged(this); } catch (Exception exception) { exception.printStackTrace(); } } } }
@Override public void setSelectedIndex(int selectedIndex) { this.selectedIndex = selectedIndex; for (ComponentListener listener : getListeners()) { if (listener instanceof ComboBoxListener) { try { ((ComboBoxListener) listener).onComboBoxSelectionChanged(this); } catch (Exception exception) { exception.printStackTrace(); } } } }