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