Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Anyone know much about JColorChoosers?

 
J Ellis
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic