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]
======================================================================