Dimension () { Dimension s = getEmptyText().getPreferredSize(); JBInsets.addTo(s, getInsets()); Dimension size = super.getPreferredSize(); return new Dimension(Math.max(s.width, size.width), Math.max(s.height, size.height)); }