void (ComponentEvent event) { int height = !myErrorText.isVisible() ? 0 : event.getComponent().getHeight(); if (height != myHeight) { myHeight = height; myResizeInProgress = true; myErrorText.setMinimumSize(new Dimension(0, height)); JRootPane root = myPeer.getRootPane(); if (root != null) { root.validate(); } if (myActualSize != null && !shouldAddErrorNearButtons()) { myPeer.setSize(myActualSize.width, myActualSize.height + height); } myErrorText.revalidate(); myResizeInProgress = false; } }