Java Swing Tutorial - Java Point.setLocation(Point p)


Point.setLocation(Point p) has the following syntax.

public void setLocation(Point p)


In the following code shows how to use Point.setLocation(Point p) method.

//from   w w  w  . jav  a 2s . c om
import java.awt.Point;

public class Main {
  public static void main(String[] args) {
    Point p = new Point();
    p.setLocation(new Point(2,3));

The code above generates the following result.