FileDocCategorySizeDatePackage
ColorBoxes2.javaAPI DocExample4563Mon Apr 06 18:10:22 BST 1998None

CBox2

public class CBox2 extends Canvas

Fields Summary
private static final Color[]
colors
private Color
cColor
Constructors Summary
Methods Summary
private static final java.awt.ColornewColor()

       
    return colors[
      (int)(Math.random() * colors.length)
    ];
  
voidnextColor()

    cColor = newColor();
    repaint();
  
public voidpaint(java.awt.Graphics g)

    g.setColor(cColor);
    Dimension s = getSize();
    g.fillRect(0, 0, s.width, s.height);