@Override public void actionPerformed(ActionEvent e) { Color chosen = JColorChooser.showDialog(null, button.getName(), button.getColor()); if (chosen != null) { button.setColor(chosen); button.getCheckBox().ifPresent(checkBox -> checkBox.setSelected(true)); } }
public void setValues() { for (ColorButton but : buttons) { but.setColor(Globals.prefs.getColor(but.getKey())); } }