Transferable (JComponent c) { final TreePath path = getTree().getPathForRow(getTree().getLeadSelectionRow()); if (path != null) { return new TextTransferable(StringUtil.join(ContainerUtil.mapNotNull(path.getPath(), o -> o == path.getPath()[0] ? null : o.toString()), " | ")); } return null; }