|
Clever Color Chooser for Java Swing |
|
|
|
|
Saturday, 10 January 2009 20:53 |
|
The default Java Swing Color Chooser is great. However it has some disadvantages: - "No color" is not supported.
- You can't define a custom palette. For many situations the standard palette has too many colors, especially too many with similar values.
The CleverColorChooser has both, and both optional. Here is how to use the class: CleverColorChooser colorChooser = new CleverColorChooser( "Color Chooser", // title passed to the Java Color Chooser dialog Color.white, // "start color", null allowed colors, // color array for custom palette, null allowed true // true if "no color" is allowed );
 This is how the Clever Color Chooser looks. 1) A custom color palette and the "no color" button. 2) Only the palette button. 3) Only the "no color" button. 4) Only the color label and the button for opening the standard Java Swing Color Chooser. Source code is here
|
|
Last Updated on Monday, 26 January 2009 10:26 |