wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes TextField background color inconsistencies Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "TextField background color inconsistencies" Watch "TextField background color inconsistencies" New topic
Author

TextField background color inconsistencies

Karen Parker
Greenhorn

Joined: May 16, 2001
Posts: 15
We're working on a Java 1.1.8 applet where we want to draw some stuff on a canvas, and have a number of corresponding TextFields with the same background color as the images on the canvas.
For example, we want to draw a yellow arrow and have a textfield in our applet that is the same color of yellow as the arrow.
We create a color using RGB values and the new Color(int, int, int) constructor. We set the background of the TextField to this color, and also set the current Graphics object color to the same thing when we are drawing on the canvas.
The problem is, the "yellow" TextField ends up looking a fair bit lighter than the "yellow" shapes on our canvas. The only time this doesn't happen is if we use one of the predefined java Colors (e.g. Color.yellow) instead of using RGB values to create our own.
 
 
subject: TextField background color inconsistencies
 
Similar Threads
Why does it not show the new coordinates?!!??!!
Colour picker, MouseDown(Event, int x, int y) Depreciation Help!
how to use rgb color values to set JPanel background color
ListCellRenderer!!!Help!!
problem with StringTokenizer