public double getWidth(Graphics pen)
    {
        if(myText.length() == 0)
            return 0;
        
        Graphics2D p = (Graphics2D)pen;
        FontRenderContext frc = p.getFontRenderContext();
        TextLayout layout = new TextLayout(myText, FONT, frc);
        return layout.getBounds().getWidth();
    }