JDK-4193384 : Constructor swing.JColorChooser(Color) sets incorrect initial color
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_2.5.1
  • CPU: sparc
  • Submitted: 1998-11-30
  • Updated: 2000-02-24
  • Resolved: 2000-02-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.0 merlinFixed
Related Reports
Relates :  
Description

Name: aaC67449			Date: 11/30/98


Constructor swing.JColorChooser(Color initialColor) sets incorrect initial color.
It doesnt set the color property correctly but instead sets it to some approximate value.


See example.

--------------- Example---------------------------
import java.awt.*;
import javax.swing.*;
public class Test extends JApplet{

   public static void main(String argv[]) {
      Color test = new Color(11,12,13);
      JColorChooser c= new JColorChooser(test);
      if(!test.equals(c.getColor())) {
              System.out.println("FAILED. InitialColor:"+c.getColor()+" Should be "+test);
      } else {
            System.out.println("PASSED!");
     }
      
   
  }
}

----------------output------------------
FAILED. InitialColor:java.awt.Color[r=10,g=11,b=12] Should be java.awt.Color[r=11,g=12,b=13]


======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin FIXED IN: merlin INTEGRATED IN: merlin
14-06-2004

EVALUATION The DefaultHSBChooserPanel is changing the value as the value is set from the palette. This causes an off by one error. It has been fixed in the rewrite of the DefaultHSBChooserPanel. mark.davidson@Eng 2000-02-14
14-02-2000