{ metrics = getContainer().getFontMetrics(getContainer().getFont());
    public float getPreferredSpan(int axis)    {      if (axis == X_AXIS)        return getWidth();      else if (axis == Y_AXIS)        {          metrics = getContainer().getFontMetrics(getContainer().getFont());          return numLines * metrics.getHeight();         }            throw new IllegalArgumentException("Invalid axis for getPreferredSpan: "                                         + axis);    }