<Swing Dev> JColorChooser on GTK (GTKColorChooserPanel)
enh at jessies.org
Mon May 25 16:04:25 PDT 2009
I just had a quick look at the native GTK+ color dialog next to a Swing
JColorChooser. A number of problems stand out:
[*] Transferring focus out of the "Color name:" field should update the
[*] The "Color name:" field should accept X11 color names.
[*] "Color Name:" should be "Color name:".
[*] "R_ed:" should be "_Red:" (mnemonic index).
[*] The absence of a preview panel (i.e. a zero-sized preview panel, since
a null preview panel is not allowed) should imply no separator. Since the
preview panel is non-GTK anyway, I think the GTK panel shouldn't have that
separator. Advanced users are going to remove the preview panel, and naive
users won't notice (and have no real right to complain it's "wrong",
because it isn't). (Sun bug 6417110.)
[*] Labels and fields should be aligned on their baselines, not against
the tops of their GridBagLayout cells.
[*] Spinner labels should be left-aligned. (Sun bug 4943902.)
[*] Spacing between columns of spinners is wrong. (Sun bug 4943902;
actually an optical illusion caused by the wrong alignment.)
* Spacing above and below the separator between the spinners and the
"Color name:" field is wrong.
* Focus cycle is H,R,S,G,V,B but should be H,S,V,R,G,B.
* The swatch is missing a border.
* "Dropper" button is missing (Sun bug 4869100).
* H,S,V seem to be percentages in the native dialog, not 0-360, 0-255, 0-255.
* The focus indicator on the circle/triangle component is wrong (should be
a dotted square border; is a solid circle).
* The rendering of the circle/triangle component is horribly aliased;
should be smooth.
At a higher level, JColorChooser itself should:
* Use an empty preview panel with GTK+. (Sun bug 6417110.)
* Not have a "Reset" button with GTK+. (Sun bug 6417110, 4943902.)
* Order the other buttons "Cancel", "OK" (instead of the wrong way round).
(Sun bug 6417110.)
* Have the "Cancel" and "OK" buttons the same size. (Sun bugs 6417110,
* Use standard GTK+ "Cancel" and "OK" icons. (Sun bug 6417110.)
* Use standard GTK+ "_Cancel" and "_OK" mnemonics. (Sun bug 6417110,
(A lot of these suggest to me that JColorChooser should use JOptionPane,
which has already been fixed to get a lot of these things right. In my own
code, I only use JColorChooser as an embeddable panel for these reasons,
which is why I've separated these bugs out: I don't really care about
Anyway, I have fixes for the first four (marked "[*]" rather than "*"),
and wondered if there's any interest. Should I raise one bug for the stuff
I've? Lots of extra bugs for the problems that don't already have bugs?
One big bug for the stuff I've fixed and lots of little bugs for the stuff
I've yet to look at?
Or is the GTK JColorChooser going to be replaced with native code?
Oh, and do I need to sort out the SCA before I show patches, or just
before they can be submitted? (I've deliberately not attached anything
here in case you don't want to see code not covered by an SCA. I haven't
filled out the SCA yet because, not living in the 1980s, I don't have easy
access to either a fax machine or a scanner.)
Elliott Hughes, http://www.jessies.org/~enh/
More information about the swing-dev