Write a method to draw a text string rotated 90 degrees to the right down the right side of the picture.

What will be an ideal response?


```
public void addRightText ( String text )
{

// set up the rotation tranform
AffineTrans form rotateTrans form =
new AffineTrans form ( );
rotateTrans form. translate ( this . getWidth ( ) - 20 ,
-( this . getHeight ( ) / 2 ) ) ;
rotateTrans form . rotate (Math. toRadians ( 9 0 ) ) ;
// get the graphics 2dobject from the result
Graphics graphics = this.getGraphics ( ) ;
Graphics2D g2 = (Graphics2D) graphics ;
AffineTrans form savedTrans = g2.getTransform ( ) ;
g2.setTrans form ( rotateTrans form ) ;
g2.setColor ( Color .BLACK) ;
g2.drawString ( text , 400 , 0 ) ;
g2.setTrans form ( savedTrans ) ;
}
```

Computer Science & Information Technology

You might also like to view...

What is the time complexity of the following program?

double a = 0, b = 0; for (int x = 0; x <= N; x++ ) { for (int y = 0; y <= N; y++ ) { a += Math.random(); } } for (int x = 0; x <= N; x++ ) { b += Math.random(); } a. O(N^2) b. O(n^2 + n) c. O(n) d. O(1)

Computer Science & Information Technology

How will the parameter query request display when the query is run?

A. Pop-up message B. Status Bar message C. Pop-up menu of options D. Help message box

Computer Science & Information Technology

If you wish to present traffic trends on your company's Website, a  _____ format is preferable to tabular formats.?

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

When drawing curved segments, anchor points that connect the curved segments are called what?

What will be an ideal response?

Computer Science & Information Technology