/** * ColorTest draws samples of all system color instances.<p> * * Copyright &copy; 1997 Martin Minow. All Rights Reserved.<p> * * Permission to use, copy, modify, and redistribute this software and its * documentation for personal, non-commercial use is hereby granted provided that * this copyright notice and appropriate documentation appears in all copies. This * software may not be distributed for fee or as part of commercial, "shareware," * and/or not-for-profit endevors including, but not limited to, CD-ROM collections, * online databases, and subscription services without specific license.<p> * * @author <a href="mailto:minow@apple.com">Martin Minow</a> * @version 1.0 * Set tabs every 4 characters. */import java.util.*;import java.awt.*;/** * Display all system color values. Requires Java 1.1 *//* * Note the following bug. *		g.setColor(SystemColor.xxx) has no effect. Workaround by executing *		g.setColor(new Color((SystemColor.xxx).getRGB())), which is wierd. */class ColorTestPanel extends Panel {	public static final int	colorWidth		= 24;	// public Font				font			= new Font("Courier", Font.PLAIN, 10);	public static final String		longName		= "inactiveCaptionBorder";	public static final String[]	systemColorName = {		"activeCaption",	"activeCaptionBorder",		"activeCaptionText",		"control",			"controlDkShadow",			"controlHighlight",		"controlLtHilight", "controlShadow",			"controlText",		"desktop",		"inactiveCaption",	"inactiveCaptionBorder",	"inactiveCaptionText",		"info",				"infoText",		"menu",				"menuText",		"scrollbar",		"text",				"textHighlight",			"textHighlightText",		"textInactiveText", "textText",		"window",			"windowBorder",				"windowText"	};	public static final SystemColor[]	systemColor = {		SystemColor.activeCaption,		SystemColor.activeCaptionBorder,		SystemColor.activeCaptionText,		SystemColor.control,		SystemColor.controlDkShadow,		SystemColor.controlHighlight,		SystemColor.controlLtHighlight,		SystemColor.controlShadow,		SystemColor.controlText,		SystemColor.desktop,		SystemColor.inactiveCaption,		SystemColor.inactiveCaptionBorder,		SystemColor.inactiveCaptionText,		SystemColor.info,		SystemColor.infoText,		SystemColor.menu,		SystemColor.menuText,		SystemColor.scrollbar,		SystemColor.text,		SystemColor.textHighlight,		SystemColor.textHighlightText,		SystemColor.textInactiveText,		SystemColor.textText,		SystemColor.window,		SystemColor.windowBorder,		SystemColor.windowText	};	public ColorTestPanel()	{		this.setLayout(new GridLayout(0, 4, 1, 1));		// setFont(new Font("Courier", Font.PLAIN, 10));		for (int i = 0; i < systemColorName.length; i++) {			this.add(new ColorTestCell(systemColor[i], systemColorName[i]));		}	}}	