The modified addMessage method

The modified  version of the addMessage method is shown in Listing 2.

One of the original statements shown in Listing 2

This modification

Listing 2. The modified addMessage method.
 
 public void addMessage(
                      String message, int xPos, int yPos){
   // get a graphics context to use to draw on the
   // buffered image
   Graphics2D graphics2d = bufferedImage.createGraphics();

   // set the color to white
   //graphics2d.setPaint(Color.white);
   
   //modified by baldwin on 12/23/08
   graphics2d.setPaint(messageColor);

   // set the font to Helvetica bold style and size 16
   graphics2d.setFont(new Font("Helvetica",Font.BOLD,16));

   // draw the message
   graphics2d.drawString(message,xPos,yPos);

 }//end addMessage
File: at.htm [Next] [Prev]