void (final Component c) { JBIterable<JScrollPane> scrollPanes = uiTraverser(c) .expand(o -> o == c || o instanceof JPanel || o instanceof JLayeredPane) .filter(JScrollPane.class); for (JScrollPane scrollPane : scrollPanes) { Integer keepBorderSides = ClientProperty.get(scrollPane, KEEP_BORDER_SIDES); if (keepBorderSides != null) { if (scrollPane.getBorder() instanceof LineBorder) { Color color = ((LineBorder)scrollPane.getBorder()).getLineColor(); scrollPane.setBorder(new SideBorder(color, keepBorderSides.intValue())); } else { scrollPane.setBorder(new SideBorder(NamedColorUtil.getBoundsColor(), keepBorderSides.intValue())); } } else { scrollPane.setBorder(new SideBorder(NamedColorUtil.getBoundsColor(), SideBorder.NONE)); } } }