}
public static Rect getFrame(String s, double x, double y, Graphics g) {
if(s != null && g != null) {
FontMetrics fm = g.getFontMetrics();
return new Rect(x-fm.stringWidth(s)*0.5, y-fm.getHeight()*0.5,
fm.stringWidth(s), fm.getHeight());
} else
return new Rect(0, 0, 0, 0);
}