Prev Up
Go backward to Adding the Color Value Rectangles
Go up to Drawing the Color Display

Adding the Text

The last things to add to the background drawing method are the instruction to draw the numbers representing the red, green and blue values in the corresponding rectangles on the screen. The "drawString" method will do the job (from the computer's point of view any list of symbols from the keyboard that you want displayed on the screen is a "string" whether made up of alphabetic characters, digits, punctuation, etc). The hard part will be getting the x and y coordinates right for each drawString.

You will use the parameter names as placeholders for the actual values to be displayed.

Again, it probably makes sense to get the instruction for the "red" number to work first and then copy and alter it for the other two values.


Prev Up