Perform drawing as shown in Java's documentation