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