Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TextField background color inconsistencies

 
Karen Parker
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic