Example usage for java.awt Rectangle getBounds

List of usage examples for java.awt Rectangle getBounds

Introduction

In this page you can find the example usage for java.awt Rectangle getBounds.

Prototype

@Transient
public Rectangle getBounds() 

Source Link

Document

Gets the bounding Rectangle of this Rectangle .

Usage

From source file:Main.java

public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;

    Rectangle r = new Rectangle(100, 100, 200, 200);

    g2.fill(r);/* ww  w  .ja  v a  2  s  . com*/
    System.out.println(r.getBounds());

}