private void invalidateIfNeeded() { if (myLabel.getRootPane() == null) return; Dimension d = myLabel.getSize(); Dimension pref = myLabel.getPreferredSize(); if (d != null && d.equals(pref)) { return; } setInactiveStateImage(null); myLabel.invalidate(); if (myActionPanel != null) { myActionPanel.invalidate(); } myTabs.revalidateAndRepaint(false); }