类的用途
java.awt.Color
使用 Color 的包
包
描述
提供组成 Java 辅助功能实用程序的接口和类的集合。
包含用于创建用户界面以及绘制图形和图像的所有类。
定义用户界面组件和提供对这些组件的访问的辅助技术之间的契约。
提供一组“轻量级”(全 Java 语言)组件,尽可能在所有平台上以相同的方式工作。
提供用于在 Swing 组件周围绘制专用边框的类和接口。
包含
JColorChooser 组件使用的类和接口。
提供一个接口和许多抽象类,Swing 使用这些抽象类来提供其可插入的外观功能。
提供根据基本外观构建的用户界面对象。
提供根据 Java 外观(曾经代号为 Metal )构建的用户界面对象,这是默认外观。
提供根据跨平台 Nimbus 外观构建的用户界面对象。
Synth 是一种可换肤的外观和感觉,其中所有绘画都是委托的。
提供用于处理
javax.swing.JTable 的类和接口。
提供处理可编辑和不可编辑文本组件的类和接口。
提供用于创建 HTML 文本编辑器的类
HTMLEditorKit 和支持类。
提供用于处理
javax.swing.JTree 的类和接口。
-
Color 在 com.sun.java.accessibility.util 中的用法
com.sun.java.accessibility.util 中返回 Color 的方法com.sun.java.accessibility.util 中的方法,参数类型为 Color修饰符和类型方法描述voidTranslator.setBackground(Color c) 设置此对象的背景Color。voidTranslator.setForeground(Color c) 设置此对象的前景Color。 -
Color 在 java.awt 中的用法
修饰符和类型Field描述static final ColorColor.black颜色黑色。static final ColorColor.BLACK颜色黑色。static final ColorColor.blue颜色为蓝色。static final ColorColor.BLUE颜色为蓝色。static final ColorColor.cyan颜色青色。static final ColorColor.CYAN颜色青色。static final ColorColor.DARK_GRAY颜色深灰色。static final ColorColor.darkGray颜色深灰色。static final ColorColor.gray颜色灰色。static final ColorColor.GRAY颜色灰色。static final ColorColor.green颜色绿色。static final ColorColor.GREEN颜色绿色。static final ColorColor.LIGHT_GRAY颜色浅灰色。static final ColorColor.lightGray颜色浅灰色。static final ColorColor.magenta洋红色。static final ColorColor.MAGENTA洋红色。static final ColorColor.orange颜色橙色。static final ColorColor.ORANGE颜色橙色。static final ColorColor.pink粉红色。static final ColorColor.PINK粉红色。static final ColorColor.red颜色为红色。static final ColorColor.RED颜色为红色。static final ColorColor.white颜色白色。static final ColorColor.WHITE颜色白色。static final ColorColor.yellow颜色黄色。static final ColorColor.YELLOW颜色黄色。修饰符和类型方法描述Color.brighter()创建一个新的Color,它是这个Color的更亮版本。Color.darker()创建一个新的Color,它是这个Color的深色版本。static Color将String转换为整数并返回指定的不透明Color。Component.AccessibleAWTComponent.getBackground()获取此对象的背景颜色。Component.getBackground()获取此组件的背景颜色。abstract ColorGraphics2D.getBackground()返回用于清除区域的背景颜色。List.AccessibleAWTList.AccessibleAWTListChild.getBackground()获取此对象的背景颜色。MenuComponent.AccessibleAWTMenuComponent.getBackground()获取此对象的背景颜色。TextComponent.getBackground()获取此文本组件的背景颜色。Window.getBackground()获取此窗口的背景颜色。static Color在系统属性中查找颜色。static Color在系统属性中查找颜色。static Color在系统属性中查找颜色。abstract ColorGraphics.getColor()获取此图形上下文的当前颜色。GradientPaint.getColor1()返回由点 P1 锚定的颜色 C1。GradientPaint.getColor2()返回由点 P2 锚定的颜色 C2。final Color[]MultipleGradientPaint.getColors()返回此渐变使用的颜色数组的副本。Component.AccessibleAWTComponent.getForeground()获取此对象的前景色。Component.getForeground()获取此组件的前景色。List.AccessibleAWTList.AccessibleAWTListChild.getForeground()获取此对象的前景色。MenuComponent.AccessibleAWTMenuComponent.getForeground()获取此对象的前景色。static ColorColor.getHSBColor(float h, float s, float b) 根据 HSB 颜色模型的指定值创建一个Color对象。Robot.getPixelColor(int x, int y) 返回给定屏幕坐标处像素的颜色。修饰符和类型方法描述abstract booleanGraphics.drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer) 尽可能多地绘制指定图像的指定区域,并即时缩放以适应目标可绘制表面的指定区域。abstract booleanGraphics.drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) 绘制已缩放以适合指定矩形的指定图像。abstract booleanGraphics.drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) 尽可能多地绘制当前可用的指定图像。static Color在系统属性中查找颜色。voidComponent.AccessibleAWTComponent.setBackground(Color c) 设置此对象的背景颜色。voidComponent.setBackground(Color c) 设置此组件的背景颜色。abstract voidGraphics2D.setBackground(Color color) 设置Graphics2D上下文的背景颜色。voidList.AccessibleAWTList.AccessibleAWTListChild.setBackground(Color c) 设置此对象的背景颜色。voidMenuComponent.AccessibleAWTMenuComponent.setBackground(Color c) 设置此对象的背景颜色。voidTextComponent.setBackground(Color c) 设置此文本组件的背景颜色。voidWindow.setBackground(Color bgColor) 设置此窗口的背景颜色。abstract void将此图形上下文的当前颜色设置为指定颜色。voidComponent.AccessibleAWTComponent.setForeground(Color c) 设置此对象的前景色。voidComponent.setForeground(Color c) 设置此组件的前景色。voidList.AccessibleAWTList.AccessibleAWTListChild.setForeground(Color c) 设置该对象的前景色。voidMenuComponent.AccessibleAWTMenuComponent.setForeground(Color c) 设置此对象的前景色。abstract voidGraphics.setXORMode(Color c1) 将此图形上下文的绘制模式设置为在此图形上下文的当前颜色和新的指定颜色之间交替。修饰符构造方法描述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) 构造一个LinearGradientPaintRadialGradientPaint(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) 构造一个RadialGradientPaintRadialGradientPaint(Rectangle2D gradientBounds, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod) 使用默认的SRGB颜色空间构造一个RadialGradientPaint。 -
Color 在 javax.accessibility 中的用法
javax.accessibility 中返回 Color 的方法修饰符和类型方法描述AccessibleComponent.getBackground()获取此对象的背景颜色。AccessibleComponent.getForeground()获取此对象的前景色。javax.accessibility 中的方法,参数类型为 Color修饰符和类型方法描述voidAccessibleComponent.setBackground(Color c) 设置此对象的背景颜色。voidAccessibleComponent.setForeground(Color c) 设置此对象的前景色。 -
Color 在 javax.swing 中的用法
javax.swing 中的字段声明为 Color修饰符和类型Field描述protected ColorJTable.gridColor网格的颜色。protected ColorJTable.selectionBackground所选单元格的背景颜色。protected ColorJTable.selectionForeground所选单元格的前景色。javax.swing 中返回 Color 的方法修饰符和类型方法描述static ColorDebugGraphics.flashColor()返回用于闪烁绘图操作的颜色。JList.AccessibleJList.AccessibleJListChild.getBackground()JTable.AccessibleJTable.AccessibleJTableCell.getBackground()获取此对象的背景颜色。JTree.AccessibleJTree.AccessibleJTreeNode.getBackground()获取此对象的背景颜色。JTabbedPane.getBackgroundAt(int index) 返回index处的选项卡背景颜色。DebugGraphics.getColor()返回用于文本绘制操作的颜色。JColorChooser.getColor()从颜色选择器获取当前颜色值。如果key的值是一个Color返回它,否则返回null。如果给定Locale的key的值是一个Color返回它,否则返回null。static Color从默认值返回颜色。static Color从适合给定locale的默认值返回颜色。JList.AccessibleJList.AccessibleJListChild.getForeground()JTable.AccessibleJTable.AccessibleJTableCell.getForeground()获取此对象的前景色。JTree.AccessibleJTree.AccessibleJTreeNode.getForeground()获取此对象的前景色。JTabbedPane.getForegroundAt(int index) 返回index处的选项卡前景色。JTable.getGridColor()返回用于绘制网格线的颜色。JList.getSelectionBackground()返回用于绘制所选项目背景的颜色。JTable.getSelectionBackground()返回所选单元格的背景颜色。JList.getSelectionForeground()返回用于绘制所选项目前景的颜色。JTable.getSelectionForeground()返回所选单元格的前景色。static ColorJColorChooser.showDialog(Component component, String title, Color initialColor) 显示模态颜色选择器对话框并阻塞,直到对话框被隐藏。static ColorJColorChooser.showDialog(Component component, String title, Color initialColor, boolean colorTransparencySelectionEnabled) 显示模态颜色选择器对话框并阻塞,直到对话框被隐藏。javax.swing 中的方法,参数类型为 Color修饰符和类型方法描述static BorderBorderFactory.createBevelBorder(int type, Color highlight, Color shadow) 使用指定的突出显示和阴影创建指定类型的斜角边框。static BorderBorderFactory.createBevelBorder(int type, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner) 使用内部和外部高光和阴影区域的指定颜色创建指定类型的斜角边框。static BorderBorderFactory.createEtchedBorder(int type, Color highlight, Color shadow) 使用指定的突出显示和阴影颜色创建具有“蚀刻”外观的边框。static BorderBorderFactory.createEtchedBorder(Color highlight, Color shadow) 使用指定的突出显示和阴影颜色创建具有“蚀刻”外观的边框。static BorderBorderFactory.createLineBorder(Color color) 创建具有指定颜色的线条边框。static BorderBorderFactory.createLineBorder(Color color, int thickness) 创建具有指定颜色和宽度的线条边框。static BorderBorderFactory.createLineBorder(Color color, int thickness, boolean rounded) 创建具有指定颜色、粗细和角形状的线条边框。static MatteBorderBorderFactory.createMatteBorder(int top, int left, int bottom, int right, Color color) 使用纯色创建无光泽边框。static BorderBorderFactory.createSoftBevelBorder(int type, Color highlight, Color shadow) 使用指定的突出显示和阴影创建具有软角的指定类型的斜角边框。static BorderBorderFactory.createSoftBevelBorder(int type, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner) 为高亮区域和阴影区域的内边缘和外边缘使用指定的颜色,创建具有软角的指定类型的斜角边框。static TitledBorderBorderFactory.createTitledBorder(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor) 使用指定的位置、字体和颜色向现有边框添加标题。booleanDebugGraphics.drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer) 重写Graphics.drawImagebooleanDebugGraphics.drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) 重写Graphics.drawImagebooleanDebugGraphics.drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) 重写Graphics.drawImagevoidJComponent.setBackground(Color bg) 设置此组件的背景颜色。voidJList.AccessibleJList.AccessibleJListChild.setBackground(Color c) voidJTable.AccessibleJTable.AccessibleJTableCell.setBackground(Color c) 设置此对象的背景颜色。voidJTree.AccessibleJTree.AccessibleJTreeNode.setBackground(Color c) 设置此对象的背景颜色。voidJTabbedPane.setBackgroundAt(int index, Color background) 将index的背景颜色设置为background可以是null,在这种情况下,选项卡的背景颜色将默认为tabbedpane的背景颜色。void设置用于绘制和填充线条和形状的颜色。void将颜色选择器的当前颜色设置为指定颜色。static voidDebugGraphics.setFlashColor(Color flashColor) 设置用于闪烁绘图操作的颜色。voidJComponent.setForeground(Color fg) 设置此组件的前景色。voidJList.AccessibleJList.AccessibleJListChild.setForeground(Color c) voidJTable.AccessibleJTable.AccessibleJTableCell.setForeground(Color c) 设置此对象的前景色。voidJTree.AccessibleJTree.AccessibleJTreeNode.setForeground(Color c) voidJTabbedPane.setForegroundAt(int index, Color foreground) 将index的前景色设置为foreground,可以是null,在这种情况下,选项卡的前景色将默认为此tabbedpane的前景色。voidJTable.setGridColor(Color gridColor) 将用于绘制网格线的颜色设置为gridColor并重新显示。voidJList.setSelectionBackground(Color selectionBackground) 设置用于绘制所选项目背景的颜色,单元格渲染器可以使用该颜色填充所选单元格。voidJTable.setSelectionBackground(Color selectionBackground) 设置选定单元格的背景颜色。voidJList.setSelectionForeground(Color selectionForeground) 设置用于绘制所选项目前景的颜色,单元格渲染器可用于渲染文本和图形。voidJTable.setSelectionForeground(Color selectionForeground) 设置选定单元格的前景色。voidDebugGraphics.setXORMode(Color aColor) 重写Graphics.setXORModestatic ColorJColorChooser.showDialog(Component component, String title, Color initialColor) 显示模态颜色选择器对话框并阻塞,直到对话框被隐藏。static ColorJColorChooser.showDialog(Component component, String title, Color initialColor, boolean colorTransparencySelectionEnabled) 显示模态颜色选择器对话框并阻塞,直到对话框被隐藏。javax.swing 中的构造函数,参数类型为 Color -
Color 在 javax.swing.border 中的用法
javax.swing.border 中的字段声明为 Color修饰符和类型Field描述protected ColorMatteBorder.color为边框呈现的颜色。protected ColorEtchedBorder.highlight用于蚀刻高光的颜色。protected ColorBevelBorder.highlightInner用于斜面内部高光的颜色。protected ColorBevelBorder.highlightOuter用于斜面外部高光的颜色。protected ColorLineBorder.lineColor边框的颜色。protected ColorEtchedBorder.shadow用于蚀刻阴影的颜色。protected ColorBevelBorder.shadowInner用于斜角内部阴影的颜色。protected ColorBevelBorder.shadowOuter用于斜面外阴影的颜色protected ColorTitledBorder.titleColor标题的颜色。javax.swing.border 中返回 Color 的方法修饰符和类型方法描述EtchedBorder.getHighlightColor()返回蚀刻边框的高亮颜色。EtchedBorder.getHighlightColor(Component c) 返回在指定组件上呈现时蚀刻边框的突出显示颜色。BevelBorder.getHighlightInnerColor()返回斜角边框的内部高亮颜色。BevelBorder.getHighlightInnerColor(Component c) 返回在指定组件上渲染时斜角边框的内部高亮颜色。BevelBorder.getHighlightOuterColor()返回斜角边框的外部突出显示颜色。BevelBorder.getHighlightOuterColor(Component c) 返回在指定组件上呈现时斜角边框的外部突出显示颜色。LineBorder.getLineColor()返回边框的颜色。MatteBorder.getMatteColor()返回用于平铺边框的颜色,如果使用平铺图标,则返回 null。EtchedBorder.getShadowColor()返回蚀刻边框的阴影颜色。EtchedBorder.getShadowColor(Component c) 返回在指定组件上呈现时蚀刻边框的阴影颜色。BevelBorder.getShadowInnerColor()返回斜角边框的内部阴影颜色。BevelBorder.getShadowInnerColor(Component c) 返回在指定组件上呈现时斜角边框的内部阴影颜色。BevelBorder.getShadowOuterColor()返回斜角边框的外部阴影颜色。BevelBorder.getShadowOuterColor(Component c) 返回在指定组件上渲染时斜角边框的外部阴影颜色。TitledBorder.getTitleColor()返回标题边框的标题颜色。javax.swing.border 中的方法,参数类型为 Colorjavax.swing.border 中的构造函数,参数类型为 Color修饰符构造方法描述BevelBorder(int bevelType, Color highlight, Color shadow) 创建具有指定类型、高亮和阴影颜色的斜角边框。BevelBorder(int bevelType, Color highlightOuterColor, Color highlightInnerColor, Color shadowOuterColor, Color shadowInnerColor) 创建具有指定类型、高亮和阴影颜色的斜角边框。EtchedBorder(int etchType, Color highlight, Color shadow) 创建具有指定蚀刻类型、高亮和阴影颜色的蚀刻边框。EtchedBorder(Color highlight, Color shadow) 使用指定的高亮和阴影颜色创建一个较低的蚀刻边框。LineBorder(Color color) 创建具有指定颜色且粗细 = 1 的线条边框。LineBorder(Color color, int thickness) 创建具有指定颜色和粗细的线条边框。LineBorder(Color color, int thickness, boolean roundedCorners) 创建具有指定颜色、粗细和角形状的线条边框。MatteBorder(int top, int left, int bottom, int right, Color matteColor) 创建具有指定insets和颜色的无光泽边框。MatteBorder(Insets borderInsets, 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 实例。 -
Color 在 javax.swing.colorchooser 中的用法
javax.swing.colorchooser 中返回 Color 的方法修饰符和类型方法描述protected ColorAbstractColorChooserPanel.getColorFromModel()返回当前选择的颜色。ColorSelectionModel.getSelectedColor()返回选定的Color,它应该是非null。DefaultColorSelectionModel.getSelectedColor()返回选定的Color,它应该是非null。javax.swing.colorchooser 中的方法,参数类型为 Color修饰符和类型方法描述voidColorSelectionModel.setSelectedColor(Color color) 将所选颜色设置为color。voidDefaultColorSelectionModel.setSelectedColor(Color color) 将所选颜色设置为color。javax.swing.colorchooser 中的构造函数,参数类型为 Color修饰符构造方法描述DefaultColorSelectionModel(Color color) 创建一个DefaultColorSelectionModel,当前颜色设置为color,它应该是非null。 -
Color 在 javax.swing.plaf 中的用法
javax.swing.plaf 中 Color 的子类javax.swing.plaf 中的构造函数,参数类型为 Color修饰符构造方法描述BevelBorderUIResource(int bevelType, Color highlight, Color shadow) 构造一个BevelBorderUIResourceBevelBorderUIResource(int bevelType, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner) 构造一个BevelBorderUIResource构造一个ColorUIResourceEtchedBorderUIResource(int etchType, Color highlight, Color shadow) 构造一个EtchedBorderUIResource。EtchedBorderUIResource(Color highlight, Color shadow) 构造一个EtchedBorderUIResource。LineBorderUIResource(Color color) 构造一个LineBorderUIResourceLineBorderUIResource(Color color, int thickness) 构造一个LineBorderUIResourceMatteBorderUIResource(int top, int left, int bottom, int right, Color color) 构造一个MatteBorderUIResourceTitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor) 构造一个TitledBorderUIResource -
Color 在 javax.swing.plaf.basic 中的用法
javax.swing.plaf.basic 中的字段声明为 Color修饰符和类型Field描述protected ColorBasicMenuItemUI.acceleratorForeground加速器前景的颜色。protected ColorBasicMenuItemUI.acceleratorSelectionForeground加速器选择的颜色。protected ColorBasicBorders.ButtonBorder.darkShadow暗影的颜色。protected ColorBasicBorders.FieldBorder.darkShadow暗影的颜色。protected ColorBasicTabbedPaneUI.darkShadowDark shadow 颜色protected ColorBasicMenuItemUI.disabledForeground禁用前景的颜色。protected ColorBasicToolBarUI.dockingBorderColor停靠边框的颜色。protected ColorBasicToolBarUI.dockingColor停靠边框的背景颜色。protected ColorBasicToolBarUI.floatingBorderColor非停靠边框的颜色。protected ColorBasicToolBarUI.floatingColor非停靠边框的背景色。protected ColorBasicTabbedPaneUI.focus焦点颜色protected ColorBasicBorders.ButtonBorder.highlight突出显示的颜色。protected ColorBasicBorders.FieldBorder.highlight突出显示的颜色。protected ColorBasicBorders.SplitPaneBorder.highlight高光颜色protected ColorBasicSeparatorUI.highlight突出显示的颜色。protected ColorBasicTabbedPaneUI.highlight高亮颜色protected ColorBasicBorders.ButtonBorder.lightHighlight光高亮的颜色。protected ColorBasicBorders.FieldBorder.lightHighlight光高亮的颜色。protected ColorBasicTabbedPaneUI.lightHighlight灯光高亮颜色protected ColorBasicInternalFrameTitlePane.notSelectedTextColor未选中文本的颜色。protected ColorBasicInternalFrameTitlePane.notSelectedTitleColor未选中标题的颜色。protected ColorBasicInternalFrameTitlePane.selectedTextColor所选文本的颜色。protected ColorBasicInternalFrameTitlePane.selectedTitleColor所选标题的颜色。protected ColorBasicMenuItemUI.selectionBackground选择背景的颜色。protected ColorBasicMenuItemUI.selectionForeground选择前景的颜色。protected ColorBasicBorders.ButtonBorder.shadow阴影的颜色。protected ColorBasicBorders.FieldBorder.shadow阴影的颜色。protected ColorBasicBorders.SplitPaneBorder.shadow阴影的颜色protected ColorBasicSeparatorUI.shadow阴影的颜色。protected ColorBasicTabbedPaneUI.shadow阴影颜色protected ColorBasicScrollBarUI.thumbColor拇指颜色protected ColorBasicScrollBarUI.thumbDarkShadowColor拇指深色阴影颜色protected ColorBasicScrollBarUI.thumbHighlightColor拇指高亮颜色protected ColorBasicScrollBarUI.thumbLightShadowColor拇指光影颜色protected ColorBasicScrollBarUI.trackColor赛道颜色protected ColorBasicScrollBarUI.trackHighlightColor轨迹高亮颜色javax.swing.plaf.basic 中返回 Color 的方法修饰符和类型方法描述BasicToolBarUI.DragWindow.getBorderColor()返回边框颜色。BasicToolBarUI.getDockingColor()获取停靠区域上方显示的颜色BasicToolBarUI.getFloatingColor()获取浮动区域上方显示的颜色protected ColorBasicSliderUI.getFocusColor()返回焦点颜色。protected ColorBasicTreeUI.getHashColor()返回哈希颜色。protected ColorBasicSliderUI.getHighlightColor()返回突出显示颜色。protected ColorBasicProgressBarUI.getSelectionBackground()“selectionBackground”是在进度条的未填充区域上绘制时文本的颜色。protected ColorBasicProgressBarUI.getSelectionForeground()“selectionForeground”是在进度条的填充区域上绘制时文本的颜色。protected ColorBasicSliderUI.getShadowColor()返回阴影颜色。javax.swing.plaf.basic 中的方法,参数类型为 Color修饰符和类型方法描述static voidBasicGraphicsUtils.drawBezel(Graphics g, int x, int y, int w, int h, boolean isPressed, boolean isDefault, Color shadow, Color darkShadow, Color highlight, Color lightHighlight) 绘制边框。static voidBasicGraphicsUtils.drawEtchedRect(Graphics g, int x, int y, int w, int h, Color shadow, Color darkShadow, Color highlight, Color lightHighlight) 绘制蚀刻矩形。static voidBasicGraphicsUtils.drawGroove(Graphics g, int x, int y, int w, int h, Color shadow, Color highlight) 绘制凹槽。static voidBasicGraphicsUtils.drawLoweredBezel(Graphics g, int x, int y, int w, int h, Color shadow, Color darkShadow, Color highlight, Color lightHighlight) 绘制一个降低的边框。protected voidBasicMenuItemUI.paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) 绘制菜单项的背景。protected voidBasicMenuItemUI.paintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap) 绘制菜单项。voidBasicToolBarUI.DragWindow.setBorderColor(Color c) 设置边框颜色。voidBasicToolBarUI.setDockingColor(Color c) 设置停靠区域上方显示的颜色voidBasicToolBarUI.setFloatingColor(Color c) 设置浮动区域上方显示的颜色protected voidBasicTreeUI.setHashColor(Color color) 设置散列颜色。javax.swing.plaf.basic 中的构造函数,参数类型为 Color修饰符构造方法描述BasicArrowButton(int direction, Color background, Color shadow, Color darkShadow, Color highlight) 创建一个BasicArrowButton,其箭头以指定方向和指定颜色绘制。ButtonBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight) 构造ButtonBorder的新实例。FieldBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight) 构造FieldBorder的新实例。MenuBarBorder(Color shadow, Color highlight) 构造MenuBarBorder的新实例。RadioButtonBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight) 构造RadioButtonBorder的新实例。RolloverButtonBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight) 构造一个RolloverButtonBorder的新实例。SplitPaneBorder(Color highlight, Color shadow) 构造SplitPaneBorder的新实例。ToggleButtonBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight) 构造ToggleButtonBorder的新实例。 -
Color 在 javax.swing.plaf.metal 中的用法
javax.swing.plaf.metal 中的字段声明为 Color修饰符和类型Field描述protected static ColorMetalSliderUI.darkShadowColor暗影的颜色。protected ColorMetalButtonUI.disabledTextColor禁用颜色的颜色。protected ColorMetalRadioButtonUI.disabledTextColor禁用文本的颜色。protected ColorMetalToggleButtonUI.disabledTextColor禁用文本的颜色。protected ColorMetalButtonUI.focusColor聚焦按钮的颜色。protected ColorMetalRadioButtonUI.focusColor获得焦点的单选按钮的颜色。protected ColorMetalToggleButtonUI.focusColor焦点切换按钮的颜色。protected static ColorMetalSliderUI.highlightColor突出显示的颜色。protected ColorMetalButtonUI.selectColor所选按钮的颜色。protected ColorMetalRadioButtonUI.selectColor所选单选按钮的颜色。protected ColorMetalTabbedPaneUI.selectColor所选窗格的颜色。protected ColorMetalToggleButtonUI.selectColor选定按钮的颜色。protected ColorMetalTabbedPaneUI.selectHighlight突出显示的颜色。protected ColorMetalTabbedPaneUI.tabAreaBackground选项卡背景的颜色。protected static ColorMetalSliderUI.thumbColor大拇指的颜色javax.swing.plaf.metal 中返回 Color 的方法修饰符和类型方法描述protected ColorMetalTabbedPaneUI.getColorForGap(int currentRun, int x, int y) 返回间隙的颜色。protected ColorMetalButtonUI.getDisabledTextColor()返回禁用文本的颜色。protected ColorMetalRadioButtonUI.getDisabledTextColor()返回禁用文本的颜色。protected ColorMetalToggleButtonUI.getDisabledTextColor()返回禁用文本的颜色。protected ColorMetalButtonUI.getFocusColor()返回获得焦点的按钮的颜色。protected ColorMetalRadioButtonUI.getFocusColor()返回聚焦的JRadioButton的颜色。protected ColorMetalToggleButtonUI.getFocusColor()返回获得焦点的切换按钮的颜色。protected ColorMetalButtonUI.getSelectColor()返回所选按钮的颜色。protected ColorMetalRadioButtonUI.getSelectColor()返回所选JRadioButton的颜色。protected ColorMetalToggleButtonUI.getSelectColor()返回选定按钮的颜色。 -
Color 在 javax.swing.plaf.nimbus 中的用法
javax.swing.plaf.nimbus 中返回 Color 的方法修饰符和类型方法描述protected final ColorAbstractRegionPainter.decodeColor(Color color1, Color color2, float midPoint) 解码并返回一种颜色,该颜色源自其他两种颜色之间的偏移量。protected final ColorAbstractRegionPainter.decodeColor(String key, float hOffset, float sOffset, float bOffset, int aOffset) 解码并返回一种颜色,该颜色派生自 UI 默认值中的基色。protected ColorNimbusStyle.getColorForState(SynthContext ctx, ColorType type) 返回指定状态的颜色。protected final ColorAbstractRegionPainter.getComponentColor(JComponent c, String property, Color defaultColor, float saturationOffset, float brightnessOffset, int alphaOffset) 从给定的 JComponent 获取颜色属性。protected final ColorNimbusLookAndFeel.getDerivedColor(Color color1, Color color2, float midPoint) 解码并返回一种颜色,该颜色源自其他两种颜色之间的偏移量。protected final ColorNimbusLookAndFeel.getDerivedColor(Color color1, Color color2, float midPoint, boolean uiResource) 解码并返回一种颜色,该颜色源自其他两种颜色之间的偏移量。NimbusLookAndFeel.getDerivedColor(String uiDefaultParentName, float hOffset, float sOffset, float bOffset, int aOffset, boolean uiResource) 获取派生颜色,派生颜色是共享实例,是颜色值会随着父UIDefault颜色的变化而变化。javax.swing.plaf.nimbus 中的方法,参数类型为 Color修饰符和类型方法描述protected final ColorAbstractRegionPainter.decodeColor(Color color1, Color color2, float midPoint) 解码并返回一种颜色,该颜色源自其他两种颜色之间的偏移量。protected final LinearGradientPaintAbstractRegionPainter.decodeGradient(float x1, float y1, float x2, float y2, float[] midpoints, Color[] colors) 给定用于创建 LinearGradientPaint 的参数,此方法将创建并返回线性渐变绘画。protected final RadialGradientPaintAbstractRegionPainter.decodeRadialGradient(float x, float y, float r, float[] midpoints, Color[] colors) 给定用于创建 RadialGradientPaint 的参数,此方法将创建并返回径向渐变绘制。protected final ColorAbstractRegionPainter.getComponentColor(JComponent c, String property, Color defaultColor, float saturationOffset, float brightnessOffset, int alphaOffset) 从给定的 JComponent 获取颜色属性。protected final ColorNimbusLookAndFeel.getDerivedColor(Color color1, Color color2, float midPoint) 解码并返回一种颜色,该颜色源自其他两种颜色之间的偏移量。protected final ColorNimbusLookAndFeel.getDerivedColor(Color color1, Color color2, float midPoint, boolean uiResource) 解码并返回一种颜色,该颜色源自其他两种颜色之间的偏移量。 -
Color 在 javax.swing.plaf.synth 中的用法
javax.swing.plaf.synth 中返回 Color 的方法修饰符和类型方法描述SynthStyle.getColor(SynthContext context, ColorType type) 返回指定状态的颜色。protected abstract ColorSynthStyle.getColorForState(SynthContext context, ColorType type) 返回指定状态的颜色。 -
Color 在 javax.swing.table 中的用法
javax.swing.table 中返回 Color 的方法修饰符和类型方法描述JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getBackground()JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getForeground()javax.swing.table 中的方法,参数类型为 Color修饰符和类型方法描述voidDefaultTableCellRenderer.setBackground(Color c) 覆盖JComponent.setBackground以将未选择的背景颜色分配给指定的颜色。voidJTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.setBackground(Color c) voidDefaultTableCellRenderer.setForeground(Color c) 覆盖JComponent.setForeground以将未选择的前景色分配给指定的颜色。voidJTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.setForeground(Color c) -
Color 在 javax.swing.text 中的用法
javax.swing.text 中返回 Color 的方法修饰符和类型方法描述DefaultStyledDocument.getBackground(AttributeSet attr) 从属性集中获取背景颜色。GlyphView.getBackground()获取背景颜色以用于呈现字形。LabelView.getBackground()获取用于呈现字形的背景颜色。static ColorStyleConstants.getBackground(AttributeSet a) 从属性列表中获取背景颜色设置。StyleContext.getBackground(AttributeSet attr) 获取一组属性并将其转换为背景颜色规范。StyledDocument.getBackground(AttributeSet attr) 获取一组属性并将其转换为背景颜色规范。JTextComponent.getCaretColor()获取用于呈现插入符号的当前颜色。DefaultHighlighter.DefaultHighlightPainter.getColor()返回突出显示的颜色。JTextComponent.getDisabledTextColor()获取用于呈现禁用文本的当前颜色。DefaultStyledDocument.getForeground(AttributeSet attr) 从属性集中获取前景色。GlyphView.getForeground()获取前景色以用于呈现字形。LabelView.getForeground()获取用于呈现字形的前景色。static ColorStyleConstants.getForeground(AttributeSet a) 从属性列表中获取前景色设置。StyleContext.getForeground(AttributeSet attr) 获取一组属性并将其转换为前景颜色规范。StyledDocument.getForeground(AttributeSet attr) 获取一组属性并将其转换为前景颜色规范。JTextComponent.getSelectedTextColor()获取用于呈现所选文本的当前颜色。JTextComponent.getSelectionColor()获取用于呈现选择的当前颜色。javax.swing.text 中的方法,参数类型为 Color修饰符和类型方法描述protected voidLabelView.setBackground(Color bg) 设置视图的背景颜色。static voidStyleConstants.setBackground(MutableAttributeSet a, Color fg) 设置背景颜色。voidJTextComponent.setCaretColor(Color c) 设置用于呈现插入符号的当前颜色。voidJTextComponent.setDisabledTextColor(Color c) 设置用于呈现禁用文本的当前颜色。static voidStyleConstants.setForeground(MutableAttributeSet a, Color fg) 设置前景色。voidJTextComponent.setSelectedTextColor(Color c) 设置用于呈现所选文本的当前颜色。voidJTextComponent.setSelectionColor(Color c) 设置用于呈现选择的当前颜色。javax.swing.text 中的构造函数,参数类型为 Color -
Color 在 javax.swing.text.html 中的用法
javax.swing.text.html 中返回 Color 的方法修饰符和类型方法描述StyleSheet.getBackground(AttributeSet a) 获取一组属性并将其转换为背景颜色规范。StyleSheet.getForeground(AttributeSet a) 获取一组属性并将其转换为前景颜色规范。StyleSheet.stringToColor(String string) 将颜色字符串(例如“RED”或“#NNNNNN”)转换为颜色。 -
Color 在 javax.swing.tree 中的用法
javax.swing.tree 中的字段声明为 Color修饰符和类型Field描述protected ColorDefaultTreeCellRenderer.backgroundNonSelectionColor未选择节点时用于背景的颜色。protected ColorDefaultTreeCellRenderer.backgroundSelectionColor选择节点时用于背景的颜色。protected ColorDefaultTreeCellEditor.borderSelectionColor如果应绘制边框选择颜色,则为真。protected ColorDefaultTreeCellRenderer.borderSelectionColor当节点具有焦点时用于焦点指示器的颜色。protected ColorDefaultTreeCellRenderer.textNonSelectionColor用于未选定节点的前景的颜色。protected ColorDefaultTreeCellRenderer.textSelectionColor用于选定节点前景的颜色。javax.swing.tree 中返回 Color 的方法修饰符和类型方法描述DefaultTreeCellRenderer.getBackgroundNonSelectionColor()返回用于非选定节点的背景颜色。DefaultTreeCellRenderer.getBackgroundSelectionColor()如果选择了节点,则返回用于背景的颜色。DefaultTreeCellEditor.getBorderSelectionColor()返回绘制边框的颜色。DefaultTreeCellRenderer.getBorderSelectionColor()返回绘制边框的颜色。DefaultTreeCellRenderer.getTextNonSelectionColor()返回未选择节点时绘制文本的颜色。DefaultTreeCellRenderer.getTextSelectionColor()返回选择节点时绘制文本的颜色。javax.swing.tree 中的方法,参数类型为 Color修饰符和类型方法描述voidDefaultTreeCellRenderer.setBackground(Color color) 子类化以将ColorUIResource映射到 null。voidDefaultTreeCellRenderer.setBackgroundNonSelectionColor(Color newColor) 设置用于非选定节点的背景颜色。voidDefaultTreeCellRenderer.setBackgroundSelectionColor(Color newColor) 如果选择了节点,则设置用于背景的颜色。voidDefaultTreeCellEditor.setBorderSelectionColor(Color newColor) 设置边框使用的颜色。voidDefaultTreeCellRenderer.setBorderSelectionColor(Color newColor) 设置边框使用的颜色。voidDefaultTreeCellRenderer.setTextNonSelectionColor(Color newColor) 设置未选择节点时绘制文本的颜色。voidDefaultTreeCellRenderer.setTextSelectionColor(Color newColor) 设置选中节点时绘制文本的颜色。