aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JColorChooser white doesn't fire event Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JColorChooser white doesn Watch "JColorChooser white doesn New topic
Author

JColorChooser white doesn't fire event

Con Lu
Ranch Hand

Joined: Aug 27, 2002
Posts: 38
I have been using a JColorChooser dialog which
sets the colors of a graph.
It seems to work except when choosing the color
white.
Debugging code to console shows that when choosing
white, ChangeEvents aren't fired, unlike other colors.
Any help would be much appreciated,
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

That's because white is the color that is initially selected and ChangeEvents are fired only when the selection changes. If white is already selected and you select it again, the selection does not change. Make sure you initialize the default color of the JColorChooser to the color of the component you are trying to change, something like :



Then the JColorChooser and the Graph will be synched up.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JColorChooser white doesn't fire event