static int getTextWidth(final Font f, final String text) {
		Rectangle2D boundingRectangle = f.getStringBounds(text, 0, text.length(), new FontRenderContext(null, false, false));
		return (int)Math.ceil(boundingRectangle.getWidth());
	}