void (int hideableHeight) { if (hideableHeight == 0) return; getWindow().addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { e.getComponent().removeComponentListener(this); refreshDetails(false, true); } }); mySplitter.skipNextLayout(); myDetailsSplitter.getComponent().skipNextLayout(); Dimension dialogSize = getSize(); setSize(dialogSize.width, dialogSize.height + hideableHeight); repaint(); }