Java java.awt Point fields, constructors, methods, implement or subclass

Example usage for Java java.awt Point fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.awt Point.

The text is from its open source code.

Subclass

java.awt.Point has subclasses.
Click this link to see all its subclasses.

Constructor

Point()
Constructs and initializes a point at the origin (0, 0) of the coordinate space.
Point(int x, int y)
Constructs and initializes a point at the specified (x,y) location in the coordinate space.
Point(Point p)
Constructs and initializes a point with the same location as the specified Point object.

Method

Objectclone()
Creates a new object of the same class and with the same contents as this object.
doubledistance(Point2D pt)
Returns the distance from this Point2D to a specified Point2D .
booleanequals(Object obj)
Determines whether or not two points are equal.
PointgetLocation()
Returns the location of this point.
doublegetX()
doublegetY()
voidmove(int x, int y)
Moves this point to the specified location in the (x,y) coordinate plane.
voidsetLocation(int x, int y)
Changes the point to have the specified location.
voidsetLocation(double x, double y)
Sets the location of this point to the specified double coordinates.
voidsetLocation(Point p)
Sets the location of the point to the specified location.
StringtoString()
Returns a string representation of this point and its location in the (x,y) coordinate space.
voidtranslate(int dx, int dy)
Translates this point, at location (x,y) , by dx along the x axis and dy along the y axis so that it now represents the point (x+dx,y+dy) .