Drawing Rotated Text:画旋转字

//Draw string rotated clockwise 90 degrees.

AffineTransform at = new AffineTransform();

at.setToRotation(Math.PI/2.0);

g2d.setTransform(at);

g2d.drawString("aString", x, y);

// Draw string rotated counter-clockwise 90 degrees.

at = new AffineTransform();

at.setToRotation(-Math.PI/2.0);

g2d.setTransform(at);

g2d.drawString("aString", x, y);

你可能感兴趣的:(text)