List of usage examples for java.awt Rectangle createUnion
public Rectangle2D createUnion(Rectangle2D r)
From source file:Main.java
public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; Rectangle r = new Rectangle(10, 10, 50, 40); System.out.println(r.createUnion(new Rectangle(20, 20, 40, 40))); g2.fill(r);/* w ww. java2 s. c om*/ }