JDK-6317840 : JColorChooser should display hex colour number
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2005-08-30
  • Updated: 2011-02-16
  • Resolved: 2008-07-18
Related Reports
Duplicate :  
Description
A DESCRIPTION OF THE REQUEST :
Previously someone asked to allow hex in the JColorChooser and was rejected. My request is more modest, that the hex colour number merely be displayed non-editable on the three JColorchooser panels.




JUSTIFICATION :
That effectively lets you select using hex, and export colors to Java source, css etc.  It can done with with 20 lines of code.

I waste so much time converting these numbers by hand and making errors. Many customers are trying to match HTML colours or uses matching colours in HTML. They don't even know how to covert the hex.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I just want the hex colour number displayed ideally is a way I can copy paste somewhere else.
ACTUAL -
All you see are the decimal colour numbers.

---------- BEGIN SOURCE ----------
  Color newColor = JColorChooser.showDialog( this,"Choose Color",textArea.getBackground() );
   
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Use a hex calculator, which can no longer be found in stores.

Comments
EVALUATION Default RGB panel was rewritten in the fix for the 6552812 bug. It looks like default HSV, HSL and CMYK panels but contains hex-code text field.
18-07-2008