void () { myInplaceComponent.revalidate(); Dimension size = myInplaceComponent.getPreferredSize(); myInplaceComponent.setSize(Math.max(size.width, myPreferredWidth), myInplaceComponent.getHeight()); myInplaceComponent.revalidate(); repaint(); }