void (@NotNull JComponent c) { if (myContent != null) { remove(myContent); } myContent = c; if (ExperimentalUI.isNewUI()) { JScrollPane scrollPane = UIUtil.findComponentOfType(myContent, JScrollPane.class); AdjustmentListener listener = event -> { ClientProperty.put(myContent, SCROLLED_STATE, event.getAdjustable().getValue() != 0); repaint(); }; if (scrollPane != null) { scrollPane.getVerticalScrollBar().addAdjustmentListener(listener); scrollPane.getHorizontalScrollBar().addAdjustmentListener(listener); } } add(c, BorderLayout.CENTER); if (myBorderless) { UIUtil.removeScrollBorder(c); } revalidate(); repaint(); }