Exemplo n.º 1
0
  public void itemStateChanged(ItemEvent event) {
    Object src = event.getSource();

    // Check if it is the coupled background choice
    if (src == coupledBackgroundOnOffMenu) {
      coupledBackgroundOnOff = coupledBackgroundOnOffMenu.getState();
      if (coupledBackgroundOnOff) {
        currentBackgroundColor = currentColor;
        backgroundColorMenu.setCurrent(currentColor);
        Color3f color = (Color3f) colors[currentColor].value;
        background.setColor(color);
        backgroundColorMenu.setEnabled(false);
      } else {
        backgroundColorMenu.setEnabled(true);
      }
    }

    // Handle all other checkboxes
    super.itemStateChanged(event);
  }