System Colors
Home ] Up ] Foreground Color ] Background Color ] [ System Colors ]

 

 

Java also provides a set of colors based on your system's current set of GUI colors.  Access to these colors is provided via the SystemColor class.

Here's what I get when I display those colors on my home Windows XP system, which I run with the default Windows XP style and default color scheme:

When I switch the Windows color scheme to Olive Green, and run the above program again, it gives me:

Note that the SystemColor class extends from the Color class.

In addition, note that the uppercase versions of the names for these system colors are not synonymous with the lowercase versions:

  • Lowercase names refer to an instance of SystemColor
  • Uppercase names provide an integer value, which is an index into an array of SystemColors contained within the SystemColor class
 

This page was last modified on 02 October, 2007