Class SystemColor
java.lang.Object
java.awt.Color
java.awt.SystemColor
- All Implemented Interfaces:
Paint, Transparency, Serializable
A class to encapsulate symbolic colors representing the color of
native GUI objects on a system. For systems which support the dynamic
update of the system colors (when the user changes the colors)
the actual RGB values of these symbolic colors will also change
dynamically. In order to compare the "current" RGB value of a
SystemColor object with a non-symbolic Color object,
getRGB should be used rather than equals.
Note that the way in which these system colors are applied to GUI objects may vary slightly from platform to platform since GUI objects may be rendered differently on each platform.
System color values may also be available through the getDesktopProperty
method on java.awt.Toolkit.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe array index for theactiveCaptionsystem color.static final intThe array index for theactiveCaptionBordersystem color.static final intThe array index for theactiveCaptionTextsystem color.static final SystemColorThe color rendered for the window-title background of the currently active window.static final SystemColorThe color rendered for the border around the currently active window.static final SystemColorThe color rendered for the window-title text of the currently active window.static final SystemColorThe color rendered for the background of control panels and control objects, such as pushbuttons.static final intThe array index for thecontrolsystem color.static final intThe array index for thecontrolDkShadowsystem color.static final intThe array index for thecontrolHighlightsystem color.static final intThe array index for thecontrolLtHighlightsystem color.static final intThe array index for thecontrolShadowsystem color.static final intThe array index for thecontrolTextsystem color.static final SystemColorThe color rendered for dark shadow areas on 3D control objects, such as pushbuttons.static final SystemColorThe color rendered for light areas of 3D control objects, such as pushbuttons.static final SystemColorThe color rendered for highlight areas of 3D control objects, such as pushbuttons.static final SystemColorThe color rendered for shadow areas of 3D control objects, such as pushbuttons.static final SystemColorThe color rendered for the text of control panels and control objects, such as pushbuttons.static final SystemColorThe color rendered for the background of the desktop.static final intThe array index for thedesktopsystem color.static final intThe array index for theinactiveCaptionsystem color.static final intThe array index for theinactiveCaptionBordersystem color.static final intThe array index for theinactiveCaptionTextsystem color.static final SystemColorThe color rendered for the window-title background of inactive windows.static final SystemColorThe color rendered for the border around inactive windows.static final SystemColorThe color rendered for the window-title text of inactive windows.static final SystemColorThe color rendered for the background of tooltips or spot help.static final intThe array index for theinfosystem color.static final intThe array index for theinfoTextsystem color.static final SystemColorThe color rendered for the text of tooltips or spot help.static final SystemColorThe color rendered for the background of menus.static final intThe array index for themenusystem color.static final intThe array index for themenuTextsystem color.static final SystemColorThe color rendered for the text of menus.static final intThe number of system colors in the array.static final SystemColorThe color rendered for the background of scrollbars.static final intThe array index for thescrollbarsystem color.static final SystemColorThe color rendered for the background of text control objects, such as textfields and comboboxes.static final intThe array index for thetextsystem color.static final intThe array index for thetextHighlightsystem color.static final intThe array index for thetextHighlightTextsystem color.static final intThe array index for thetextInactiveTextsystem color.static final intThe array index for thetextTextsystem color.static final SystemColorThe color rendered for the background of selected items, such as in menus, comboboxes, and text.static final SystemColorThe color rendered for the text of selected items, such as in menus, comboboxes, and text.static final SystemColorThe color rendered for the text of inactive items, such as in menus.static final SystemColorThe color rendered for the text of text control objects, such as textfields and comboboxes.static final SystemColorThe color rendered for the background of interior regions inside windows.static final intThe array index for thewindowsystem color.static final intThe array index for thewindowBordersystem color.static final intThe array index for thewindowTextsystem color.static final SystemColorThe color rendered for the border around interior regions inside windows.static final SystemColorThe color rendered for text of interior regions inside windows.Fields declared in class Color
black, BLACK, blue, BLUE, cyan, CYAN, DARK_GRAY, darkGray, gray, GRAY, green, GREEN, LIGHT_GRAY, lightGray, magenta, MAGENTA, orange, ORANGE, pink, PINK, red, RED, white, WHITE, yellow, YELLOWModifier and TypeFieldDescriptionstatic final ColorThe color black.static final ColorThe color black.static final ColorThe color blue.static final ColorThe color blue.static final ColorThe color cyan.static final ColorThe color cyan.static final ColorThe color dark gray.static final ColorThe color dark gray.static final ColorThe color gray.static final ColorThe color gray.static final ColorThe color green.static final ColorThe color green.static final ColorThe color light gray.static final ColorThe color light gray.static final ColorThe color magenta.static final ColorThe color magenta.static final ColorThe color orange.static final ColorThe color orange.static final ColorThe color pink.static final ColorThe color pink.static final ColorThe color red.static final ColorThe color red.static final ColorThe color white.static final ColorThe color white.static final ColorThe color yellow.static final ColorThe color yellow.Fields declared in interface Transparency
BITMASK, OPAQUE, TRANSLUCENTModifier and TypeFieldDescriptionstatic final intRepresents image data that is guaranteed to be either completely opaque, with an alpha value of 1.0, or completely transparent, with an alpha value of 0.0.static final intRepresents image data that is guaranteed to be completely opaque, meaning that all pixels have an alpha value of 1.0.static final intRepresents image data that contains or might contain arbitrary alpha values between and including 0.0 and 1.0. -
Method Summary
Methods declared in class Color
brighter, createContext, darker, decode, equals, getAlpha, getBlue, getColor, getColor, getColor, getColorComponents, getColorComponents, getColorSpace, getComponents, getComponents, getGreen, getHSBColor, getRed, getRGB, getRGBColorComponents, getRGBComponents, getTransparency, hashCode, HSBtoRGB, RGBtoHSBModifier and TypeMethodDescriptionbrighter()Creates a newColorthat is a brighter version of thisColor.createContext(ColorModel cm, Rectangle r, Rectangle2D r2d, AffineTransform xform, RenderingHints hints) Creates and returns aPaintContextused to generate a solid color field pattern.darker()Creates a newColorthat is a darker version of thisColor.static ColorConverts aStringto an integer and returns the specified opaqueColor.booleanDetermines whether another object is equal to thisColor.intgetAlpha()Returns the alpha component in the range 0-255.intgetBlue()Returns the blue component in the range 0-255 in the default sRGB space.static ColorFinds a color in the system properties.static ColorFinds a color in the system properties.static ColorFinds a color in the system properties.float[]getColorComponents(float[] compArray) Returns afloatarray containing only the color components of theColor, in theColorSpaceof theColor.float[]getColorComponents(ColorSpace cspace, float[] compArray) Returns afloatarray containing only the color components of theColorin theColorSpacespecified by thecspaceparameter.Returns theColorSpaceof thisColor.float[]getComponents(float[] compArray) Returns afloatarray containing the color and alpha components of theColor, in theColorSpaceof theColor.float[]getComponents(ColorSpace cspace, float[] compArray) Returns afloatarray containing the color and alpha components of theColor, in theColorSpacespecified by thecspaceparameter.intgetGreen()Returns the green component in the range 0-255 in the default sRGB space.static ColorgetHSBColor(float h, float s, float b) Creates aColorobject based on the specified values for the HSB color model.intgetRed()Returns the red component in the range 0-255 in the default sRGB space.intgetRGB()Returns the RGB value representing the color in the default sRGBColorModel.float[]getRGBColorComponents(float[] compArray) Returns afloatarray containing only the color components of theColor, in the default sRGB color space.float[]getRGBComponents(float[] compArray) Returns afloatarray containing the color and alpha components of theColor, as represented in the default sRGB color space.intReturns the transparency mode for thisColor.inthashCode()Computes the hash code for thisColor.static intHSBtoRGB(float hue, float saturation, float brightness) Converts the components of a color, as specified by the HSB model, to an equivalent set of values for the default RGB model.static float[]RGBtoHSB(int r, int g, int b, float[] hsbvals) Converts the components of a color, as specified by the default RGB model, to an equivalent set of values for hue, saturation, and brightness that are the three components of the HSB model.Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Creates and returns a copy of this object.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class<?> getClass()Returns the runtime class of thisObject.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.final voidwait()Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Field Details
-
DESKTOP
-
ACTIVE_CAPTION
The array index for theactiveCaptionsystem color.- See Also:
-
ACTIVE_CAPTION_TEXT
The array index for theactiveCaptionTextsystem color.- See Also:
-
ACTIVE_CAPTION_BORDER
The array index for theactiveCaptionBordersystem color.- See Also:
-
INACTIVE_CAPTION
The array index for theinactiveCaptionsystem color.- See Also:
-
INACTIVE_CAPTION_TEXT
The array index for theinactiveCaptionTextsystem color.- See Also:
-
INACTIVE_CAPTION_BORDER
The array index for theinactiveCaptionBordersystem color.- See Also:
-
WINDOW
-
WINDOW_BORDER
The array index for thewindowBordersystem color.- See Also:
-
WINDOW_TEXT
The array index for thewindowTextsystem color.- See Also:
-
MENU
-
MENU_TEXT
-
TEXT
-
TEXT_TEXT
-
TEXT_HIGHLIGHT
The array index for thetextHighlightsystem color.- See Also:
-
TEXT_HIGHLIGHT_TEXT
The array index for thetextHighlightTextsystem color.- See Also:
-
TEXT_INACTIVE_TEXT
The array index for thetextInactiveTextsystem color.- See Also:
-
CONTROL
-
CONTROL_TEXT
The array index for thecontrolTextsystem color.- See Also:
-
CONTROL_HIGHLIGHT
The array index for thecontrolHighlightsystem color.- See Also:
-
CONTROL_LT_HIGHLIGHT
The array index for thecontrolLtHighlightsystem color.- See Also:
-
CONTROL_SHADOW
The array index for thecontrolShadowsystem color.- See Also:
-
CONTROL_DK_SHADOW
The array index for thecontrolDkShadowsystem color.- See Also:
-
SCROLLBAR
-
INFO
-
INFO_TEXT
-
NUM_COLORS
-
desktop
The color rendered for the background of the desktop. -
activeCaption
The color rendered for the window-title background of the currently active window. -
activeCaptionText
The color rendered for the window-title text of the currently active window. -
activeCaptionBorder
The color rendered for the border around the currently active window. -
inactiveCaption
The color rendered for the window-title background of inactive windows. -
inactiveCaptionText
The color rendered for the window-title text of inactive windows. -
inactiveCaptionBorder
The color rendered for the border around inactive windows. -
window
The color rendered for the background of interior regions inside windows. -
windowBorder
The color rendered for the border around interior regions inside windows. -
windowText
The color rendered for text of interior regions inside windows. -
text
The color rendered for the background of text control objects, such as textfields and comboboxes. -
textText
The color rendered for the text of text control objects, such as textfields and comboboxes. -
textHighlight
The color rendered for the background of selected items, such as in menus, comboboxes, and text. -
textHighlightText
The color rendered for the text of selected items, such as in menus, comboboxes, and text. -
textInactiveText
The color rendered for the text of inactive items, such as in menus. -
control
The color rendered for the background of control panels and control objects, such as pushbuttons. -
controlText
The color rendered for the text of control panels and control objects, such as pushbuttons. -
controlHighlight
The color rendered for light areas of 3D control objects, such as pushbuttons. This color is typically derived from thecontrolbackground color to provide a 3D effect. -
controlLtHighlight
The color rendered for highlight areas of 3D control objects, such as pushbuttons. This color is typically derived from thecontrolbackground color to provide a 3D effect. -
controlShadow
The color rendered for shadow areas of 3D control objects, such as pushbuttons. This color is typically derived from thecontrolbackground color to provide a 3D effect. -
controlDkShadow
The color rendered for dark shadow areas on 3D control objects, such as pushbuttons. This color is typically derived from thecontrolbackground color to provide a 3D effect. -
scrollbar
The color rendered for the background of scrollbars. -
info
The color rendered for the background of tooltips or spot help. -
infoText
The color rendered for the text of tooltips or spot help.
-
-
Method Details
-
toString
Returns a string representation of thisColor's values. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not benull.
-