void (@NotNull JTree tree, @NotNull Component component, @Nullable Color background, boolean opaque) { if (component instanceof JComponent) { ((JComponent)component).setOpaque(opaque); } if (background != null) { component.setBackground(background); } else if (component.isOpaque()) { component.setBackground(RenderingUtil.getBackground(tree)); } }