Dimension () { int height; Container parent = getParent(); if (isVisible() && parent != null) { height = parent.getSize().height - parent.getInsets().top - parent.getInsets().bottom; } else { height = super.getPreferredSize().height; } return new Dimension((int)(height * 2.5), height); }