import java.awt.Font;
import java.awt.geom.AffineTransform;
import java.awt.Graphics2D;
import java.awt.Graphics;

//..

public void paintComponent ( Graphics g )
   {
   super.paintComponent( g );

   // access extended 2D graphics methods.
   Graphics2D g2 = (Graphics2D)g;

   // save original transform
   AffineTransform origTransform = g.getTransform();

   // transform that shifts points 10 right and 20 up
   AffineTransform transformer = AffineTransform.getTranslateInstance ( 10.0d , -20.0d );

   // also apply a rotation.
   transformer.rotate ( Math.toRadians( 30 ) );

   // then rotate 90 degrees counter clockwise
   transformer.quadrantRotate( 1 );

   // then flip top to bottom
   transformer.scale( 1.0, -1.0 );

   // then mirror left to right
   transformer.scale( -1.0, 1.0 );

   // hook up our new transform
   g.setTransform ( transformer );

   // choose font
   g.setFont( new Font( "Sans", Font.BOLD, 24 ) );

   // draw specifying untransformed coordinates.
   g.drawString( "Hello World", 0.0d, 5.0d );

   // restore original transform
   g.setTransform( origTransform );

   }