BasicShapes.java Source code

Java tutorial

Introduction

Here is the source code for BasicShapes.java

Source

import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.geom.AffineTransform;

public class BasicShapes {
    public static void main(String[] args) {

        AffineTransform tx = new AffineTransform();
        tx.translate(1, 10);
        Rectangle shape = new Rectangle(1, 1, 1, 1);
        Shape newShape = tx.createTransformedShape(shape);

    }
}