I have the following line i my code.
page.drawString("Distance: " + dist + " pixels", 50., 50);
How can I plase this text so it always is in the center of the applet.