System Colors

In Java 1.1, the java.awt.SystemColor class is a subclass of java.awt.Color which provides color constants that match native component colors. For example, if you wanted to make the background color of your applet, the same as the background color of a window, you might use this init() method:

public void paint (Graphics g) {

  g.setColor(SystemColor.control);
  g.fillRect(0, 0, this.getSize().width, this.getSize().height);
  
}

These are the available system colors:


Previous | Next | Top | Cafe au Lait

Copyright 1997, 1998 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified October 21, 1999