Rotating the graphics context happens at the origin, ie, at (0,0) of your JPanel so the rendered text is somewhere off the screen in the direction of 45 radians which is
Math.toDegrees(45) % 360 = 58.31 degrees clockwise. 45 degrees is Math.PI/4 or
Math.toRadians(45).
The
java tutorial has some resources that you might enjoy:
The
Performing Custom Painting lesson in the
Creating a GUI with JFC/Swing trail covers the basics and contains links to more in–depth material.
The specialized trail
2D Graphics takes you a little farther. The
Transforming Shapes, Text, and Images page in the
Displaying Graphics with Graphics2D lesson has a discussion of rotating the graphics context.
Here's a demo:
[ August 04, 2004: Message edited by: Craig Wood ]