|
Code Samples Index
These code examples and other materials are subject to Sun Microsystems, Inc.
Legal Terms
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);
|
Examplets provided by permission of the publisher, Addision-Wesley,
and Author Patrick Chan.
Order this book from Amazon
|