4 /**A component for choosing a color
6 public class CbColorButton extends Panel implements CbButtonCallback,
12 Image swatch = Util.createImage(32, 16);
13 Graphics g = swatch.getGraphics();
16 CbColorButton(Color c)
18 this(c, new Vector());
21 CbColorButton(Color c, Vector p)
23 if (c == null) c = Color.black;
25 g.setColor(col); g.fillRect(0, 0, 32, 16);
26 setLayout(new BorderLayout());
27 add("Center", but = new CbButton(swatch, this));
30 public void click(CbButton b)
33 win = new CbColorWindow(col, this);
36 public void chosen(CbColorWindow w, Color c)
40 g.setColor(col); g.fillRect(0, 0, 32, 16);
46 public Vector palette(CbColorWindow w)