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:
SystemColor.desktop // Background color of
desktopSystemColor.activeCaption // Background color for
captionsSystemColor.activeCaptionText // Text color for
captionsSystemColor.activeCaptionBorder // Border color for
caption textSystemColor.inactiveCaption // Background color for
inactive captionsSystemColor.inactiveCaptionText // Text color for
inactive captionsSystemColor.inactiveCaptionBorder // Border color for
inactive captionsSystemColor.window // Background for windowsSystemColor.windowBorder // Color of window border
frameSystemColor.windowText // Text color inside
windowsSystemColor.menu // Background for menusSystemColor.menuText // Text color for menusSystemColor.text // background color for textSystemColor.textText // text color for textSystemColor.textHighlight // background color for
highlighted textSystemColor.textHighlightText // text color for
highlighted textSystemColor.control // Background color for
controlsSystemColor.controlText // Text color for
controlsSystemColor.controlLtHighlight // Light highlight color
for controlsSystemColor.controlHighlight // Highlight color for
controlsSystemColor.controlShadow // Shadow color for
controlsSystemColor.controlDkShadow // Dark shadow color for
controlsSystemColor.inactiveControlText // Text color for
inactive controlsSystemColor.scrollbar // Background color for
scrollbarsSystemColor.info // Background color for spot-help
textSystemColor.infoText // Text color for spot-help
text