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