Home Developers Clever Color Chooser for Java Swing
donate paypal

Login Form



Clever Color Chooser for Java Swing PDF Print E-mail
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
);

 clever color chooser

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
 
Storybook is a freely distributed program and is licensed under the GNU General Public License. Site Administrators may use the PAD file.

www.novelist.ch | storybook.intertec.ch | www.intertec.ch

Copyright © 2010 Martin Mustun. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.