示例#1
0
 @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));
   }
 }
示例#2
0
 public void setValues() {
   for (ColorButton but : buttons) {
     but.setColor(Globals.prefs.getColor(but.getKey()));
   }
 }