Java Shape.getBounds()
Syntax
Shape.getBounds() has the following syntax.
Rectangle getBounds()
Example
In the following code shows how to use Shape.getBounds() method.
import java.awt.Shape;
import java.awt.geom.Rectangle2D;
/* ww w . j a v a 2s.co m*/
public class Main {
public static void main(String[] args) throws Exception {
Shape s = new Rectangle2D.Double(0, 0, 72, 72);
System.out.println(s.getBounds());
}
}
Home »
Java Tutorial »
java.awt »
Java Tutorial »
java.awt »