JavaTM 2 Platform
Standard Ed. 6

类 java.awt.Color
的使用

使用 Color 的软件包
java.awt 包含用于创建用户界面和绘制图形图像的所有类。 
javax.accessibility 定义了用户界面组件与提供对这些组件进行访问的辅助技术之间的协定。 
javax.swing 提供一组“轻量级”(全部是 Java 语言)组件,尽量让这些组件在所有平台上的工作方式都相同。 
javax.swing.border 提供围绕 Swing 组件绘制特殊边框的类和接口。 
javax.swing.colorchooser 包含供 JColorChooser 组件使用的类和接口。 
javax.swing.plaf 提供一个接口和许多抽象类,Swing 用它们来提供自己的可插入外观功能。 
javax.swing.plaf.basic 提供了根据基本外观构建的用户界面对象。 
javax.swing.plaf.metal 提供根据 Java 外观(曾经代称为 Metal)构建的用户界面对象,Java 外观是默认外观。 
javax.swing.plaf.synth Synth 是一个可更换皮肤 (skinnable) 的外观,在其中可委托所有绘制。 
javax.swing.table 提供用于处理 javax.swing.JTable 的类和接口。 
javax.swing.text 提供类 HTMLEditorKit 和创建 HTML 文本编辑器的支持类。 
javax.swing.text.html 提供类 HTMLEditorKit 和创建 HTML 文本编辑器的支持类。 
javax.swing.tree 提供处理 javax.swing.JTree 的类和接口。 
 

java.awtColor 的使用
 

java.awtColor 的子类
 class SystemColor
          封装表示系统中本机 GUI 对象颜色的象征性颜色的类。
 

声明为 Colorjava.awt 中的字段
static Color Color.black
          黑色。
static Color Color.BLACK
          黑色。
static Color Color.blue
          蓝色。
static Color Color.BLUE
          蓝色。
static Color Color.cyan
          青色。
static Color Color.CYAN
          青色。
static Color Color.DARK_GRAY
          深灰色。
static Color Color.darkGray
          深灰色。
static Color Color.gray
          灰色。
static Color Color.GRAY
          灰色。
static Color Color.green
          绿色。
static Color Color.GREEN
          绿色。
static Color Color.LIGHT_GRAY
          浅灰色。
static Color Color.lightGray
          浅灰色。
static Color Color.magenta
          洋红色。
static Color Color.MAGENTA
          洋红色。
static Color Color.orange
          桔黄色。
static Color Color.ORANGE
          桔黄色。
static Color Color.pink
          粉红色。
static Color Color.PINK
          粉红色。
static Color Color.red
          红色。
static Color Color.RED
          红色。
static Color Color.white
          白色。
static Color Color.WHITE
          白色。
static Color Color.yellow
          黄色。
static Color Color.YELLOW
          黄色。
 

返回 Colorjava.awt 中的方法
 Color Color.brighter()
          创建一个新 Color,它具有比此 Color 更亮的颜色。
 Color Color.darker()
          创建一个新 Color,它具有比此 Color 更暗的颜色。
static Color Color.decode(String nm)
          将 String 转换成整数,并返回指定的不透明 Color
 Color List.AccessibleAWTList.AccessibleAWTListChild.getBackground()
          获取此对象的背景颜色。
 Color TextComponent.getBackground()
          获得此文本组件的背景色。
 Color MenuComponent.AccessibleAWTMenuComponent.getBackground()
          获取此对象的背景色。
abstract  Color Graphics2D.getBackground()
          返回用于清除区域的背景色。
 Color Component.getBackground()
          获取组件的背景色。
 Color Component.AccessibleAWTComponent.getBackground()
          获取此对象的背景色。
abstract  Color Graphics.getColor()
          获取此图形上下文的当前颜色。
static Color Color.getColor(String nm)
          查找系统属性中的一种颜色。
static Color Color.getColor(String nm, Color v)
          查找系统属性中的一种颜色。
static Color Color.getColor(String nm, int v)
          查找系统属性中的一种颜色。
 Color GradientPaint.getColor1()
          返回点 P1 的颜色 C1。
 Color GradientPaint.getColor2()
          返回点 P2 的颜色 C2。
 Color[] MultipleGradientPaint.getColors()
          返回此渐变所使用的颜色数组的副本。
 Color List.AccessibleAWTList.AccessibleAWTListChild.getForeground()
          获取此对象的前景颜色。
 Color MenuComponent.AccessibleAWTMenuComponent.getForeground()
          获取此对象的前景色。
 Color Component.getForeground()
          获取组件的前景色。
 Color Component.AccessibleAWTComponent.getForeground()
          获取此对象的前景色。
static Color Color.getHSBColor(float h, float s, float b)
          根据所指定的数值,创建一个基于 HSB 颜色模型的 Color 对象。
 Color Robot.getPixelColor(int x, int y)
          返回给定屏幕坐标处的像素颜色。
 

参数类型为 Colorjava.awt 中的方法
abstract  boolean Graphics.drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
          绘制指定图像中当前可用的图像。
abstract  boolean Graphics.drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
          绘制指定图像中已缩放到适合指定矩形内部的图像。
abstract  boolean Graphics.drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)
          绘制当前可用的指定图像的指定区域,动态地缩放图像使其符合目标绘制表面的指定区域。
static Color Color.getColor(String nm, Color v)
          查找系统属性中的一种颜色。
 void List.AccessibleAWTList.AccessibleAWTListChild.setBackground(Color c)
          设置此对象的背景颜色。
 void TextComponent.setBackground(Color c)
          设置此文本组件的背景色。
 void MenuComponent.AccessibleAWTMenuComponent.setBackground(Color c)
          设置此对象的背景色。
abstract  void Graphics2D.setBackground(Color color)
          设置 Graphics2D 上下文的背景色。
 void Component.setBackground(Color c)
          设置组件的背景色。
 void Component.AccessibleAWTComponent.setBackground(Color c)
          设置此对象的背景色。
abstract  void Graphics.setColor(Color c)
          将此图形上下文的当前颜色设置为指定颜色。
 void List.AccessibleAWTList.AccessibleAWTListChild.setForeground(Color c)
          设置此对象的前景颜色。
 void MenuComponent.AccessibleAWTMenuComponent.setForeground(Color c)
          设置此对象的前景色。
 void Component.setForeground(Color c)
          设置组件的前景色。
 void Component.AccessibleAWTComponent.setForeground(Color c)
          设置此对象的前景色。
abstract  void Graphics.setXORMode(Color c1)
          将此图形上下文的绘图模式设置为在此图形上下文的当前颜色和新的指定颜色之间交替。
 

参数类型为 Colorjava.awt 中的构造方法
GradientPaint(float x1, float y1, Color color1, float x2, float y2, Color color2)
          构造一个简单的非周期性 GradientPaint 对象。
GradientPaint(float x1, float y1, Color color1, float x2, float y2, Color color2, boolean cyclic)
          根据 boolean 参数构造一个周期性或非周期性的 GradientPaint 对象。
GradientPaint(Point2D pt1, Color color1, Point2D pt2, Color color2)
          构造一个简单的非周期性 GradientPaint 对象。
GradientPaint(Point2D pt1, Color color1, Point2D pt2, Color color2, boolean cyclic)
          根据 boolean 参数构造一个周期性或非周期性的 GradientPaint 对象。
LinearGradientPaint(float startX, float startY, float endX, float endY, float[] fractions, Color[] colors)
          构造一个具有默认 NO_CYCLE 重复方法和 SRGB 颜色空间的 LinearGradientPaint
LinearGradientPaint(float startX, float startY, float endX, float endY, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
          构造一个具有默认 SRGB 颜色空间的 LinearGradientPaint
LinearGradientPaint(Point2D start, Point2D end, float[] fractions, Color[] colors)
          构造一个具有默认 NO_CYCLE 重复方法和 SRGB 颜色空间的 LinearGradientPaint
LinearGradientPaint(Point2D start, Point2D end, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
          构造一个具有默认 SRGB 颜色空间的 LinearGradientPaint
LinearGradientPaint(Point2D start, Point2D end, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod, MultipleGradientPaint.ColorSpaceType colorSpace, AffineTransform gradientTransform)
          构造一个 LinearGradientPaint
RadialGradientPaint(float cx, float cy, float radius, float[] fractions, Color[] colors)
          用中心点作为焦点,构造一个具有默认 NO_CYCLE 重复方法和 SRGB 颜色空间的 RadialGradientPaint
RadialGradientPaint(float cx, float cy, float radius, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
          用中心点作为焦点,构造一个具有默认 SRGB 颜色空间的 RadialGradientPaint
RadialGradientPaint(float cx, float cy, float radius, float fx, float fy, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
          构造一个具有默认 SRGB 颜色空间的 RadialGradientPaint
RadialGradientPaint(Point2D center, float radius, float[] fractions, Color[] colors)
          用中心点作为焦点,构造一个具有默认 NO_CYCLE 重复方法和 SRGB 颜色空间的 RadialGradientPaint
RadialGradientPaint(Point2D center, float radius, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
          用中心点作为焦点,构造一个具有默认 SRGB 颜色空间的 RadialGradientPaint
RadialGradientPaint(Point2D center, float radius, Point2D focus, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
          构造一个具有默认 SRGB 颜色空间的 RadialGradientPaint
RadialGradientPaint(Point2D center, float radius, Point2D focus, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod, MultipleGradientPaint.ColorSpaceType colorSpace, AffineTransform gradientTransform)
          构造一个 RadialGradientPaint
RadialGradientPaint(Rectangle2D gradientBounds, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
          构造一个具有默认 SRGB 颜色空间的 RadialGradientPaint
 

javax.accessibilityColor 的使用
 

返回 Colorjavax.accessibility 中的方法
 Color AccessibleComponent.getBackground()
          获取此对象的背景色。
 Color AccessibleComponent.getForeground()
          获取此对象的前景色。
 

参数类型为 Colorjavax.accessibility 中的方法
 void AccessibleComponent.setBackground(Color c)
          设置此对象的背景色。
 void AccessibleComponent.setForeground(Color c)
          设置此对象的前景色。
 

javax.swingColor 的使用
 

声明为 Colorjavax.swing 中的字段
protected  Color JTable.gridColor
          网格的颜色。
protected  Color JTable.selectionBackground
          已选定单元格的背景色。
protected  Color JTable.selectionForeground
          已选定单元格的前景色。
 

返回 Colorjavax.swing 中的方法
static Color DebugGraphics.flashColor()
          返回用于 flash 绘制操作的 Color。
 Color JTree.AccessibleJTree.AccessibleJTreeNode.getBackground()
          获取此对象的背景色。
 Color JTable.AccessibleJTable.AccessibleJTableCell.getBackground()
          获取此对象的背景色。
 Color JList.AccessibleJList.AccessibleJListChild.getBackground()
           
 Color JTabbedPane.getBackgroundAt(int index)
          返回 index 位置的选项卡背景色。
 Color DebugGraphics.getColor()
          返回用于文本绘制操作的 Color。
 Color JColorChooser.getColor()
          获取颜色选取器的当前颜色值。
 Color UIDefaults.getColor(Object key)
          如果 key 值为一个 Color,则返回它,否则返回 null
static Color UIManager.getColor(Object key)
          从默认值返回一种颜色。
 Color UIDefaults.getColor(Object key, Locale l)
          如果给定 Localekey 值为一个 Color,则返回它,否则返回 null
static Color UIManager.getColor(Object key, Locale l)
          从适合给定语言环境的默认值中返回一种颜色。
 Color JTree.AccessibleJTree.AccessibleJTreeNode.getForeground()
          获取此对象的前景色。
 Color JTable.AccessibleJTable.AccessibleJTableCell.getForeground()
          获取此对象的前景色。
 Color JList.AccessibleJList.AccessibleJListChild.getForeground()
           
 Color JTabbedPane.getForegroundAt(int index)
          返回 index 位置的选项卡背景色。
 Color JTable.getGridColor()
          返回用来绘制网格线的颜色。
 Color JTable.getSelectionBackground()
          返回选定单元格的背景色。
 Color JList.getSelectionBackground()
          返回用于绘制选定项的背景的颜色。
 Color JTable.getSelectionForeground()
          返回选定单元格的前景色。
 Color JList.getSelectionForeground()
          返回用于绘制选定项的前景的颜色。
static Color JColorChooser.showDialog(Component component, String title, Color initialColor)
          显示有模式的颜色选取器,在隐藏对话框之前一直阻塞。
 

参数类型为 Colorjavax.swing 中的方法
static Border BorderFactory.createBevelBorder(int type, Color highlight, Color shadow)
          使用指定高亮显示和阴影显示方式来创建一个指定类型的斜面边框。
static Border BorderFactory.createBevelBorder(int type, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner)
          创建一个指定类型的斜面边框,使用内部和外部高亮显示区域及阴影区域的指定颜色。
static Border BorderFactory.createEtchedBorder(Color highlight, Color shadow)
          使用指定的高亮显示颜色和阴影颜色创建一个具有“浮雕化”外观效果的边框。
static Border BorderFactory.createEtchedBorder(int type, Color highlight, Color shadow)
          使用指定的高亮显示颜色和阴影颜色创建一个具有“浮雕化”外观效果的边框。
static Border BorderFactory.createLineBorder(Color color)
          创建一个具有指定颜色的线边框。
static Border BorderFactory.createLineBorder(Color color, int thickness)
          创建一个具有指定颜色和宽度的线边框。
static MatteBorder BorderFactory.createMatteBorder(int top, int left, int bottom, int right, Color color)
          使用纯色创建一个类似衬边的边框。
static TitledBorder BorderFactory.createTitledBorder(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor)
          向现有边框添加一个标题,使其具有指定的位置、字体和颜色。
 boolean DebugGraphics.drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
          重写 Graphics.drawImage
 boolean DebugGraphics.drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
          重写 Graphics.drawImage
 boolean DebugGraphics.drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)
          重写 Graphics.drawImage
 void JTree.AccessibleJTree.AccessibleJTreeNode.setBackground(Color c)
          设置此对象的背景色。
 void JTable.AccessibleJTable.AccessibleJTableCell.setBackground(Color c)
          设置此对象的背景色。
 void JList.AccessibleJList.AccessibleJListChild.setBackground(Color c)
           
 void JComponent.setBackground(Color bg)
          设置此组件的背景色。
 void JTabbedPane.setBackgroundAt(int index, Color background)
          将 index 位置的背景色设置为 background,它可以为 null,在这种情况下选项卡的背景色默认为 tabbedpane 的背景色。
 void DebugGraphics.setColor(Color aColor)
          设置用于绘制和填充线条和图形的颜色。
 void JColorChooser.setColor(Color color)
          将颜色选取器的当前颜色设置为指定颜色。
static void DebugGraphics.setFlashColor(Color flashColor)
          设置用于 flash 绘制操作的 Color。
 void JTree.AccessibleJTree.AccessibleJTreeNode.setForeground(Color c)
           
 void JTable.AccessibleJTable.AccessibleJTableCell.setForeground(Color c)
          设置此对象的前景色。
 void JList.AccessibleJList.AccessibleJListChild.setForeground(Color c)
           
 void JComponent.setForeground(Color fg)
          设置此组件的前景色。
 void JTabbedPane.setForegroundAt(int index, Color foreground)
          将 index 位置的前景色设置为 foreground,它可以为 null,在这种情况下选项卡的前景色默认为此 tabbedpane 的前景色。
 void JTable.setGridColor(Color gridColor)
          将用来绘制网格线的颜色设置为 gridColor 并重新显示它。
 void JTable.setSelectionBackground(Color selectionBackground)
          设置选定单元格的背景色。
 void JList.setSelectionBackground(Color selectionBackground)
          设置用于绘制选定项的背景的颜色,单元渲染器可以使用此颜色填充所选单元。
 void JTable.setSelectionForeground(Color selectionForeground)
          设置选定单元格的前景色。
 void JList.setSelectionForeground(Color selectionForeground)
          设置用于绘制选定项的前景的颜色,单元渲染器可以使用此颜色呈现文本和图形。
 void DebugGraphics.setXORMode(Color aColor)
          重写 Graphics.setXORMode
static Color JColorChooser.showDialog(Component component, String title, Color initialColor)
          显示有模式的颜色选取器,在隐藏对话框之前一直阻塞。
 

参数类型为 Colorjavax.swing 中的构造方法
JColorChooser(Color initialColor)
          创建具有指定初始颜色的颜色选取器窗格。
 

javax.swing.borderColor 的使用
 

声明为 Colorjavax.swing.border 中的字段
protected  Color MatteBorder.color
           
protected  Color EtchedBorder.highlight
           
protected  Color BevelBorder.highlightInner
           
protected  Color BevelBorder.highlightOuter
           
protected  Color LineBorder.lineColor
           
protected  Color EtchedBorder.shadow
           
protected  Color BevelBorder.shadowInner
           
protected  Color BevelBorder.shadowOuter
           
protected  Color TitledBorder.titleColor
           
 

返回 Colorjavax.swing.border 中的方法
 Color EtchedBorder.getHighlightColor()
          返回浮雕化边框的高亮显示颜色。
 Color EtchedBorder.getHighlightColor(Component c)
          返回浮雕化边框在指定组件上呈现的高亮显示颜色。
 Color BevelBorder.getHighlightInnerColor()
          返回斜面边框内部的高亮显示颜色。
 Color BevelBorder.getHighlightInnerColor(Component c)
          返回斜面边框在指定组件上呈现的内部高亮显示颜色。
 Color BevelBorder.getHighlightOuterColor()
          返回斜面边框外部的高亮显示颜色。
 Color BevelBorder.getHighlightOuterColor(Component c)
          返回斜面边框在指定组件上呈现的外部高亮显示颜色。
 Color LineBorder.getLineColor()
          返回边框的颜色。
 Color MatteBorder.getMatteColor()
          返回平铺边框的颜色,如果使用了平铺图标,则返回 null。
 Color EtchedBorder.getShadowColor()
          返回浮雕化边框的阴影颜色。
 Color EtchedBorder.getShadowColor(Component c)
          返回浮雕化边框在指定组件上呈现的阴影颜色。
 Color BevelBorder.getShadowInnerColor()
          返回斜面边框内部的阴影颜色。
 Color BevelBorder.getShadowInnerColor(Component c)
          返回斜面边框在指定组件上呈现的内部阴影颜色。
 Color BevelBorder.getShadowOuterColor()
          返回斜面边框的外部阴影颜色。
 Color BevelBorder.getShadowOuterColor(Component c)
          返回斜面边框在指定组件上呈现的外部阴影颜色。
 Color TitledBorder.getTitleColor()
          返回带标题边框的标题颜色。
 

参数类型为 Colorjavax.swing.border 中的方法
 void TitledBorder.setTitleColor(Color titleColor)
          设置带标题边框的标题颜色。
 

参数类型为 Colorjavax.swing.border 中的构造方法
BevelBorder(int bevelType, Color highlight, Color shadow)
          创建具有指定类型、高亮显示和阴影颜色的斜面边框。
BevelBorder(int bevelType, Color highlightOuterColor, Color highlightInnerColor, Color shadowOuterColor, Color shadowInnerColor)
          创建具有指定类型、高亮显示和阴影颜色的斜面边框。
EtchedBorder(Color highlight, Color shadow)
          创建具有指定高亮显示和阴影颜色的阴刻浮雕化边框
EtchedBorder(int etchType, Color highlight, Color shadow)
          创建具有指定蚀刻类型、高亮显示和阴影颜色的浮雕化边框
LineBorder(Color color)
          创建具有指定颜色、厚度为 1(thickness = 1)的线边框。
LineBorder(Color color, int thickness)
          创建具有指定颜色和厚度的线边框。
LineBorder(Color color, int thickness, boolean roundedCorners)
          创建具有指定颜色、厚度和拐角形状的线条边框。
MatteBorder(Insets borderInsets, Color matteColor)
          创建具有指定 insets 和颜色的衬边边框。
MatteBorder(int top, int left, int bottom, int right, Color matteColor)
          创建具有指定 insets 和颜色的衬边边框。
SoftBevelBorder(int bevelType, Color highlight, Color shadow)
          创建具有指定类型、高亮显示和阴影颜色的斜面边框。
SoftBevelBorder(int bevelType, Color highlightOuterColor, Color highlightInnerColor, Color shadowOuterColor, Color shadowInnerColor)
          创建具有指定类型、高亮显示和阴影颜色的斜面边框。
TitledBorder(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor)
          用指定的边框、标题、标题对齐方式、标题位置、标题字体和标题颜色创建 TitledBorder 实例。
 

javax.swing.colorchooserColor 的使用
 

返回 Colorjavax.swing.colorchooser 中的方法
protected  Color AbstractColorChooserPanel.getColorFromModel()
          返回当前所选取的颜色。
 Color ColorSelectionModel.getSelectedColor()
          返回所选取的 Color,它不应为 null
 Color DefaultColorSelectionModel.getSelectedColor()
          返回所选取的 Color,它不应为 null
 

参数类型为 Colorjavax.swing.colorchooser 中的方法
 void ColorSelectionModel.setSelectedColor(Color color)
          将选取的颜色设置为 color
 void DefaultColorSelectionModel.setSelectedColor(Color color)
          将选取的颜色设置为 color
 

参数类型为 Colorjavax.swing.colorchooser 中的构造方法
DefaultColorSelectionModel(Color color)
          创建一个 DefaultColorSelectionModel,其当前颜色被设置为 color,该颜色不应为 null
 

javax.swing.plafColor 的使用
 

javax.swing.plafColor 的子类
 class ColorUIResource
           
 

参数类型为 Colorjavax.swing.plaf 中的构造方法
BorderUIResource.BevelBorderUIResource(int bevelType, Color highlight, Color shadow)
           
BorderUIResource.BevelBorderUIResource(int bevelType, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner)
           
BorderUIResource.EtchedBorderUIResource(Color highlight, Color shadow)
           
BorderUIResource.EtchedBorderUIResource(int etchType, Color highlight, Color shadow)
           
BorderUIResource.LineBorderUIResource(Color color)
           
BorderUIResource.LineBorderUIResource(Color color, int thickness)
           
BorderUIResource.MatteBorderUIResource(int top, int left, int bottom, int right, Color color)
           
BorderUIResource.TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor)
           
ColorUIResource(Color c)
           
 

javax.swing.plaf.basicColor 的使用
 

声明为 Colorjavax.swing.plaf.basic 中的字段
protected  Color BasicMenuItemUI.acceleratorForeground
           
protected  Color BasicMenuItemUI.acceleratorSelectionForeground
           
protected  Color BasicBorders.ButtonBorder.darkShadow
           
protected  Color BasicBorders.FieldBorder.darkShadow
           
protected  Color BasicTabbedPaneUI.darkShadow
           
protected  Color BasicMenuItemUI.disabledForeground
           
protected  Color BasicToolBarUI.dockingBorderColor
           
protected  Color BasicToolBarUI.dockingColor
           
protected  Color BasicToolBarUI.floatingBorderColor
           
protected  Color BasicToolBarUI.floatingColor
           
protected  Color BasicTabbedPaneUI.focus
           
protected  Color BasicBorders.ButtonBorder.highlight
           
protected  Color BasicBorders.FieldBorder.highlight
           
protected  Color BasicBorders.SplitPaneBorder.highlight
           
protected  Color BasicTabbedPaneUI.highlight
           
protected  Color BasicSeparatorUI.highlight
           
protected  Color BasicBorders.ButtonBorder.lightHighlight
           
protected  Color BasicBorders.FieldBorder.lightHighlight
           
protected  Color BasicTabbedPaneUI.lightHighlight
           
protected  Color BasicInternalFrameTitlePane.notSelectedTextColor
           
protected  Color BasicInternalFrameTitlePane.notSelectedTitleColor
           
protected  Color BasicInternalFrameTitlePane.selectedTextColor
           
protected  Color BasicInternalFrameTitlePane.selectedTitleColor
           
protected  Color BasicMenuItemUI.selectionBackground
           
protected  Color BasicMenuItemUI.selectionForeground
           
protected  Color BasicBorders.ButtonBorder.shadow
           
protected  Color BasicBorders.FieldBorder.shadow
           
protected  Color BasicBorders.SplitPaneBorder.shadow
           
protected  Color BasicTabbedPaneUI.shadow
           
protected  Color BasicSeparatorUI.shadow
           
protected  Color BasicScrollBarUI.thumbColor
           
protected  Color BasicScrollBarUI.thumbDarkShadowColor
           
protected  Color BasicScrollBarUI.thumbHighlightColor
           
protected  Color BasicScrollBarUI.thumbLightShadowColor
           
protected  Color BasicScrollBarUI.trackColor
           
protected  Color BasicScrollBarUI.trackHighlightColor
           
 

返回 Colorjavax.swing.plaf.basic 中的方法
 Color BasicToolBarUI.DragWindow.getBorderColor()
           
 Color BasicToolBarUI.getDockingColor()
          获取在连接 (docking) 区域上时显示的颜色。
 Color BasicToolBarUI.getFloatingColor()
          获取在浮动区域上时显示的颜色。
protected  Color BasicSliderUI.getFocusColor()
           
protected  Color BasicTreeUI.getHashColor()
           
protected  Color BasicSliderUI.getHighlightColor()
           
protected  Color BasicProgressBarUI.getSelectionBackground()
          如果在进度条的未填充区域上绘制文本,则文本的颜色为 "selectionBackground"。
protected  Color BasicProgressBarUI.getSelectionForeground()
          如果在进度条的填充区域上绘制文本,文本的颜色为 "selectionForeground"。
protected  Color BasicSliderUI.getShadowColor()
           
 

参数类型为 Colorjavax.swing.plaf.basic 中的方法
static void BasicGraphicsUtils.drawBezel(Graphics g, int x, int y, int w, int h, boolean isPressed, boolean isDefault, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
           
static void BasicGraphicsUtils.drawEtchedRect(Graphics g, int x, int y, int w, int h, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
           
static void BasicGraphicsUtils.drawGroove(Graphics g, int x, int y, int w, int h, Color shadow, Color highlight)
           
static void BasicGraphicsUtils.drawLoweredBezel(Graphics g, int x, int y, int w, int h, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
           
protected  void BasicMenuItemUI.paintBackground(Graphics g, JMenuItem menuItem, Color bgColor)
          绘制菜单项的背景。
protected  void BasicMenuItemUI.paintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap)
           
 void BasicToolBarUI.DragWindow.setBorderColor(Color c)
           
 void BasicToolBarUI.setDockingColor(Color c)
          设置在连接区域上时显示的颜色。
 void BasicToolBarUI.setFloatingColor(Color c)
          设置在浮动区域上时显示的颜色。
protected  void BasicTreeUI.setHashColor(Color color)
           
 

参数类型为 Colorjavax.swing.plaf.basic 中的构造方法
BasicArrowButton(int direction, Color background, Color shadow, Color darkShadow, Color highlight)
          创建一个在指定方向上绘制其箭头并具有指定颜色的 BasicArrowButton
BasicBorders.ButtonBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
           
BasicBorders.FieldBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
           
BasicBorders.MenuBarBorder(Color shadow, Color highlight)
           
BasicBorders.RadioButtonBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
           
BasicBorders.RolloverButtonBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
           
BasicBorders.SplitPaneBorder(Color highlight, Color shadow)
           
BasicBorders.ToggleButtonBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
           
 

javax.swing.plaf.metalColor 的使用
 

声明为 Colorjavax.swing.plaf.metal 中的字段
protected static Color MetalSliderUI.darkShadowColor
           
protected  Color MetalRadioButtonUI.disabledTextColor
           
protected  Color MetalToggleButtonUI.disabledTextColor
           
protected  Color MetalButtonUI.disabledTextColor
           
protected  Color MetalRadioButtonUI.focusColor
           
protected  Color MetalToggleButtonUI.focusColor
           
protected  Color MetalButtonUI.focusColor
           
protected static Color MetalSliderUI.highlightColor
           
protected  Color MetalRadioButtonUI.selectColor
           
protected  Color MetalTabbedPaneUI.selectColor
           
protected  Color MetalToggleButtonUI.selectColor
           
protected  Color MetalButtonUI.selectColor
           
protected  Color MetalTabbedPaneUI.selectHighlight
           
protected  Color MetalTabbedPaneUI.tabAreaBackground
           
protected static Color MetalSliderUI.thumbColor
           
 

返回 Colorjavax.swing.plaf.metal 中的方法
protected  Color MetalTabbedPaneUI.getColorForGap(int currentRun, int x, int y)
           
protected  Color MetalRadioButtonUI.getDisabledTextColor()
           
protected  Color MetalToggleButtonUI.getDisabledTextColor()
           
protected  Color MetalButtonUI.getDisabledTextColor()
           
protected  Color MetalRadioButtonUI.getFocusColor()
           
protected  Color MetalToggleButtonUI.getFocusColor()
           
protected  Color MetalButtonUI.getFocusColor()
           
protected  Color MetalRadioButtonUI.getSelectColor()
           
protected  Color MetalToggleButtonUI.getSelectColor()
           
protected  Color MetalButtonUI.getSelectColor()
           
 

javax.swing.plaf.synthColor 的使用
 

返回 Colorjavax.swing.plaf.synth 中的方法
 Color SynthStyle.getColor(SynthContext context, ColorType type)
          返回指定状态的颜色。
protected abstract  Color SynthStyle.getColorForState(SynthContext context, ColorType type)
          返回指定状态的颜色。
 

javax.swing.tableColor 的使用
 

返回 Colorjavax.swing.table 中的方法
 Color JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getBackground()
           
 Color JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getForeground()
           
 

参数类型为 Colorjavax.swing.table 中的方法
 void DefaultTableCellRenderer.setBackground(Color c)
          重写 JComponent.setBackground 将未选定单元格的背景色分配为指定颜色。
 void JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.setBackground(Color c)
           
 void DefaultTableCellRenderer.setForeground(Color c)
          重写 JComponent.setForeground 将未选定单元格的前景色分配为指定颜色。
 void JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.setForeground(Color c)
           
 

javax.swing.textColor 的使用
 

返回 Colorjavax.swing.text 中的方法
 Color GlyphView.getBackground()
          获取用于呈现字形的背景色。
 Color LabelView.getBackground()
          获取用于呈现字形的背景色。
 Color DefaultStyledDocument.getBackground(AttributeSet attr)
          从属性集获得背景颜色。
 Color StyledDocument.getBackground(AttributeSet attr)
          使用一个属性集并将其转换为一个背景色规范。
static Color StyleConstants.getBackground(AttributeSet a)
          从属性列表中获取背景色设置。
 Color StyleContext.getBackground(AttributeSet attr)
          使用一个属性集并将其转换成为一个背景色规范。
 Color JTextComponent.getCaretColor()
          获取用于呈现插入符的当前颜色。
 Color DefaultHighlighter.DefaultHighlightPainter.getColor()
          返回高亮显示的颜色。
 Color JTextComponent.getDisabledTextColor()
          获取用于呈现禁用文本的当前颜色。
 Color GlyphView.getForeground()
          获取用于呈现字形的前景色。
 Color LabelView.getForeground()
          获取用于呈现字形的前景色。
 Color DefaultStyledDocument.getForeground(AttributeSet attr)
          从属性集获得前景色。
 Color StyledDocument.getForeground(AttributeSet attr)
          使用一个属性集并将其转换成为一个前景色规范。
static Color StyleConstants.getForeground(AttributeSet a)
          从属性列表中获取前景色设置。
 Color StyleContext.getForeground(AttributeSet attr)
          使用一个属性集并将其转换成为一个前景色规范。
 Color JTextComponent.getSelectedTextColor()
          获取用于呈现选定文本的当前颜色。
 Color JTextComponent.getSelectionColor()
          获取用于呈现选定的当前颜色。
 

参数类型为 Colorjavax.swing.text 中的方法
protected  void LabelView.setBackground(Color bg)
          设置视图的背景色。
static void StyleConstants.setBackground(MutableAttributeSet a, Color fg)
          设置背景色。
 void JTextComponent.setCaretColor(Color c)
          设置用于呈现插入符的当前颜色。
 void JTextComponent.setDisabledTextColor(Color c)
          设置用于呈现禁用文本的当前颜色。
static void StyleConstants.setForeground(MutableAttributeSet a, Color fg)
          设置前景色。
 void JTextComponent.setSelectedTextColor(Color c)
          设置用于呈现选定文本的当前颜色。
 void JTextComponent.setSelectionColor(Color c)
          设置用于呈现选定的当前颜色。
 

参数类型为 Colorjavax.swing.text 中的构造方法
DefaultHighlighter.DefaultHighlightPainter(Color c)
          构造新的高亮显示 painter。
StyledEditorKit.ForegroundAction(String nm, Color fg)
          创建新的 ForegroundAction。
 

javax.swing.text.htmlColor 的使用
 

返回 Colorjavax.swing.text.html 中的方法
 Color StyleSheet.getBackground(AttributeSet a)
          获取一个属性集并将其转换为背景色规范。
 Color StyleSheet.getForeground(AttributeSet a)
          获取一个属性集并将其转换为前景色规范。
 Color StyleSheet.stringToColor(String string)
          将颜色字符串(如 "RED" 或 "#NNNNNN")转换为 Color。
 

javax.swing.treeColor 的使用
 

声明为 Colorjavax.swing.tree 中的字段
protected  Color DefaultTreeCellRenderer.backgroundNonSelectionColor
          不选定节点时用于背景的颜色。
protected  Color DefaultTreeCellRenderer.backgroundSelectionColor
          选定节点时用于背景的颜色。
protected  Color DefaultTreeCellEditor.borderSelectionColor
          如果应绘制边框选择色,则为 true。
protected  Color DefaultTreeCellRenderer.borderSelectionColor
          节点具有焦点时,用于焦点指示符的颜色。
protected  Color DefaultTreeCellRenderer.textNonSelectionColor
          用于非选定节点的前景颜色。
protected  Color DefaultTreeCellRenderer.textSelectionColor
          用于选定节点的前景颜色。
 

返回 Colorjavax.swing.tree 中的方法
 Color DefaultTreeCellRenderer.getBackgroundNonSelectionColor()
          返回用于非选定节点的背景色。
 Color DefaultTreeCellRenderer.getBackgroundSelectionColor()
          返回在选定节点的情况下背景所使用的颜色。
 Color DefaultTreeCellEditor.getBorderSelectionColor()
          返回绘制边框的颜色。
 Color DefaultTreeCellRenderer.getBorderSelectionColor()
          返回绘制边框时所使用的颜色。
 Color DefaultTreeCellRenderer.getTextNonSelectionColor()
          返回未选定节点时绘制文本所使用的颜色。
 Color DefaultTreeCellRenderer.getTextSelectionColor()
          返回选定节点时绘制文本所使用的颜色。
 

参数类型为 Colorjavax.swing.tree 中的方法
 void DefaultTreeCellRenderer.setBackground(Color color)
          创建子类,以便将 ColorUIResource 映射为 null。
 void DefaultTreeCellRenderer.setBackgroundNonSelectionColor(Color newColor)
          设置用于非选定节点的背景色。
 void DefaultTreeCellRenderer.setBackgroundSelectionColor(Color newColor)
          设置在选定节点的情况下背景所使用的颜色。
 void DefaultTreeCellEditor.setBorderSelectionColor(Color newColor)
          设置用于边框的颜色。
 void DefaultTreeCellRenderer.setBorderSelectionColor(Color newColor)
          设置用于边框的颜色。
 void DefaultTreeCellRenderer.setTextNonSelectionColor(Color newColor)
          设置选定节点时绘制文本所使用的颜色。
 void DefaultTreeCellRenderer.setTextSelectionColor(Color newColor)
          设置选定节点时绘制文本所使用的颜色。
 


JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only