Ejemplo n.º 1
0
  @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();
        }
      }
    }
  }
Ejemplo n.º 2
0
  @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();
        }
      }
    }
  }