• 0

[JAVA] extend java.awt.geom.Point2D.Double


Question

Hi,

I'm trying to extend Java's Point2D.Double class but having trouble with the constructor. The Double class is nested inside the Point2D class and I don't seem to have access to the

import java.awt.geom.Point2D.Double;

public class Coordinate extends java.awt.geom.Point2D.Double
{
	public Coordinate(double x, double y)
	{
		Point2D.Double(x,y);
	}
}

That code is just one attempt at getting it to work.

I've tried import java.awt.geom.Point2D, import java.awt.geom.*...

I've tried Double(x,y);, java.awt.geom.Point2D.Double(x,y);...

I've tried extends java.awt.geom.Point2D, extends Point2D, extends Point2D.Double...

Nothing will work!

It can't find the Double() method.

T:\Coordinate.java:10: cannot find symbol
symbol  : method Double(double,double)
location: class java.awt.geom.Point2D
		Point2D.Double(x,y);

Any ides?

Link to comment
https://www.neowin.net/forum/topic/541064-java-extend-javaawtgeompoint2ddouble/
Share on other sites

2 answers to this question

Recommended Posts

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.