Create another method that takes the text, x, y, font and color to use when you draw a string.
What will be an ideal response?
```
public void drawSt r ing ( St r ing text , int x , int y ,
Font font , Color c o l o r )
{
// g e t the g r a p h i c s o b j e c t
Graphics g = this . ge tGraphi c s ( ) ;
// s e t the c o l o r
g . s e tCo l o r ( c o l o r ) ;
// s e t the f ont
g . setFont ( f ont ) ;
// draw the s t r i n g
g . drawSt r ing ( text , x , y ) ;
}
```
Rewrite the old drawString() method to call this new method.
```
public void drawStringV2 ( St r ing text , int x , int y )
{
this . drawSt r ing ( text , x , y ,
new Font ( "Ar i a l " , Font .BOLD, 2 4 ) ,
Color .BLACK) ;
}
```
You might also like to view...
What option is used to access files located on various drives?
A) Computer B) Internet Explorer C) Network Neighborhood D) Recycle Bin
Give the conflict table for each level of the multilevel control described in Section 20.8.5. Each table indicates the conflicts for the operations used to implement the transaction Move(sec1, sec2). Assume that the operation TestInc is viewed as two partial operations TestIncOK and TestIncNO.
What will be an ideal response?