aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Anyone know much about JColorChoosers? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Anyone know much about JColorChoosers?" Watch "Anyone know much about JColorChoosers?" New topic
Author

Anyone know much about JColorChoosers?

J Ellis
Greenhorn

Joined: Aug 23, 2009
Posts: 27
I have a JColorChooser in my application; I cannot use the showDialog() method, so I have it added to a normal JPanel. The API documentation says that the JColorChooser has 3 APIs, including:

The ability to create instances of JColorChooser panes directly (within any container). PropertyChange listeners can be added to detect when the current "color" property changes.

However, I added a PropertyChangeListener and it does not fire when a new color is picked on the Color Chooser; it only fires once when the chooser opens and once when it closes (for the first one the e.getNewValue() is a JPanel, for the second it is null). I have been able to add a ChangeListener to the color chooser's SelectionModel, and THAT fires every time a new color is chosen, so at that point I just check the chooser's color, but why doesn't the API work like it's supposed to?

-TennSeven
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4638
    
    5

You're right. Nowhere does the JColorChooser fire a property change "color"

You could search the bugbase to see if this has already been reported, and if not, file a bug report.


luck, db
There are no new questions, but there may be new answers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Anyone know much about JColorChoosers?