Getting the (starting) X and Y coordinates of a Path2D shape drawn on Jpanel
问题 So, I have a program where I can add shapes to JPanel using Path2D objects and then I can click and drag them around. What I want to do is be able to find the final X and Y coordinates of the shape AFTER it has been drug. The coordinates need to be the top-left coordinates . Any ideas? // add a circle to center of the screen public void addCircle(int width, int height) { Path2D circ = new Path2D.Double(); circ.append(new Ellipse2D.Double(getWidth() / 2 - width / 2, getHeight() / 2 - height /