PRB: AWT Components Only Use RGB Values (0..179) for Background Colors (225074)
The information in this article applies to:
- Microsoft virtual machine
This article was previously published under Q225074 SYMPTOMS
RGB values greater than 179 are treated as value 255 when passed to the setBackground() method on controls such as a java.awt.TextField.
CAUSE
The setBackground() method calls the brighter() method on the java.awt.Color object that is passed to it.
RESOLUTION
You can have the Component work as expected by providing an overridden class in place of the java.awt.Color object that setBackground() is expecting. In this overridden class, the brighter() method should return a reference to "this". See the "More Information" section for an example.
STATUS
This behavior is by design. To stay compatible with other, non-Microsoft virtual computers, this behavior will not change.
REFERENCES
For support information about Visual J++ and the SDK for Java, visit the following Microsoft Web site:
Modification Type: | Major | Last Reviewed: | 6/14/2006 |
---|
Keywords: | kbprb KB225074 kbAudDeveloper |
---|
|