Posted by iam_peter
on June 23, 2009 at 4:02 AM PDT
i tried to get several node (SGText) to set its location to (0,10), here is the code:
public Node extends SGText...
Node node = new Node(String value);
double x = 0;
double y = 10;
node.setLocation(new Point2D.Double(x, y));
System.out.println(node.getValue() + " " + node.getBounds() + " " + x + " " + y);
value java.awt.geom.Rectangle2D$Float[x=-2.0,y=1.0,w=41.0,h=13.0] 0.0 10.0
value java.awt.geom.Rectangle2D$Float[x=-2.0,y=-12.0,w=75.0,h=25.0] 0.0 10.0
you see that the x and y coordinates from the bounds of my SGText objaect are not the coordinates i want.
why does this happen?