Name: gm110360 Date: 12/07/2001
java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)
When you compare two colors for equality using equals( Object obj ) the test
will likely fail if one of the colors is java.awt.Color and one is
java.awt.SystemColor. Because SystemColor extends Color, you might think equals
would work. Here is the code from Color:
public boolean equals(Object obj) {
return obj instanceof Color && ((Color)obj).value == this.value;
}
The problem is that value is the rgb value in Color. In SystemColor value is
the index to the color table in systemColors.
(Review ID: 134033)
======================================================================