Get x and y coordinates of a point in javascript

Hi, I;m trying to develop a script for my research and I need to get the X and Y coordinate of a selection point. For an ImageJ script getSelectionCoordinates(xpoints, ypoints) is working properly, however, I haven’t the same results within a javascript function. How can I get the X and Y coordinate of a selection point from Java?

Dear @gabrieltorresl,

This should print the x and y coordinate of a point selection on the active image:

//@ ImagePlus impIn

importClass(Packages.ij.gui.Roi);
importClass(Packages.ij.IJ);

roi = impIn.getRoi();
IJ.log(roi.getType());
if (roi.getType() == Roi.POINT) {
	points = roi.getContainedPoints();
	IJ.log("("+points[0].x+","+points[0].y+")");
}

Best,
Stefan

Hi @stelfrich!
Would you know how to do the same in Java using the Point tool. Get the pixels when Point or MultiPoint are used in a picture.

Best,

Luis