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