Java Swing Tutorial - Java Ellipse2D.contains(double x, double y)








Syntax

Ellipse2D.contains(double x, double y) has the following syntax.

public boolean contains(double x,  double y)

Example

In the following code shows how to use Ellipse2D.contains(double x, double y) method.

/*from w  ww  .j a v  a 2s .c o m*/
import java.awt.geom.Ellipse2D;
import java.awt.geom.Point2D;

public class Main {

  public static void main(String args[]) {
    Ellipse2D.Double e = new Ellipse2D.Double(1.0,2.0,2.0,2.0);
    
    e.contains(20.0,20.0);
  }
}