/** * A choicepanel (see choicepanel.java) has several checkboxes, each of * which is an instance of the choicecheck class. * * When you check a choicecheck, it notifies the colorpanel that this * checkbox's color is being edited. */ import java.awt.*; final class ChoiceCheck extends Checkbox { final int myindex; final ChoicePanel p; ChoiceCheck(String name, CheckboxGroup cbg, boolean isset, int myindex, ChoicePanel p) { super(name, cbg, isset); this.myindex = myindex; this.p = p; } public void setState(boolean state) { if (state == true) { p.which = myindex; p.a.c.setColor(ColorApplet.s2c(p.colors[myindex])); } super.setState(state); } }