List of usage examples for java.awt.geom AffineTransform getRotateInstance
public static AffineTransform getRotateInstance(double vecx, double vecy, double anchorx, double anchory)
From source file:Main.java
public void paint(Graphics g) { Shape shape = new Rectangle2D.Float(100, 50, 80, 80); Graphics2D g2 = (Graphics2D) g; AffineTransform at = AffineTransform.getRotateInstance(0.2, 0.2, -Math.PI / 6, -Math.PI / 6); g2.setTransform(at);//www . j a va2s. com g2.draw(shape); }