JColorChooser RGB Tab with custom text

58 Views Asked by At

I am customizing JColorChooser by modifying the UIManager's defaults for the JColorChooser tabs. I have successfully customized the labels and texts except the Color Code one.

Color Code in JColorChooser's RGB tab

I used the following code to modify the contents of the RGB tab.

UIManager.put("ColorChooser.rgbRedText", "Custom Red:");
UIManager.put("ColorChooser.rgbGreenText", "Custom Green:");
UIManager.put("ColorChooser.rgbBlueText", "Custom Blue:");
UIManager.put("ColorChooser.rgbAlphaText", "Custom Alpha:");

However, when I try the same thing for Color Code it doesn't work:

UIManager.put("ColorChooser.rgbColorCodeText", "Custom Color Code:");

How can I access UIManager to customize it?

1

There are 1 best solutions below

1
Thomas Behr On BEST ANSWER

The key for the color code field label is not ColorChooser.rgbColorCodeText but ColorChooser.rgbHexCodeText.

See the ColorChooserPanel.buildChooser and ColorModel.getText source code.