Java Shape.contains(double x, double y)
Syntax
Shape.contains(double x, double y) has the following syntax.
boolean contains(double x, double y)
Example
In the following code shows how to use Shape.contains(double x, double y) method.
import java.awt.Point;
import java.awt.Shape;
import java.awt.geom.Rectangle2D;
// w w w . ja va2 s .c o 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.contains(30,40));
}
}
Home »
Java Tutorial »
java.awt »
Java Tutorial »
java.awt »