Dimension () { Graphics2D g2 = (Graphics2D) GraphicsUtil.safelyGetGraphics(this); Dimension dim = new Dimension(Integer.MAX_VALUE, g2 != null ? DEFAULT_PAINTER.getSize("DUMMY", g2.getFontMetrics(), Integer.MAX_VALUE).height + 1 : 1); JBInsets.addTo(dim, getInsets()); return dim; }