void (MouseEvent e, boolean pressed) { if (UIUtil.isUnderWin10LookAndFeel()) { Point p = e.getPoint(); TreePath path = getPathForLocation(p.x, p.y); if (path != null) { if (path.getLastPathComponent() instanceof TreeNode node) { JComponent c = (JComponent)getCellRenderer().getTreeCellRendererComponent( Tree.this, node, isPathSelected(path), isExpanded(path), getModel().isLeaf(node), getRowForPath(path), hasFocus()); if (pressed) { c.putClientProperty(UIUtil.CHECKBOX_PRESSED_PROPERTY, c instanceof JCheckBox ? getPathBounds(path) : node); } else { c.putClientProperty(UIUtil.CHECKBOX_PRESSED_PROPERTY, null); } UIUtil.repaintViewport(Tree.this); } } } }