JTree, Knoten-Selektion durch Doppel-Klick
Einen Doppelklick auf einen Treenode kann man so feststellen:
final JTree tree = new JTree(); tree.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { int row = tree.getRowForLocation(e.getX(), e.getY()); TreePath path = tree.getPathForLocation(e.getX(), e.getY()); if (row != -1) if (e.getClickCount() == 2) System.out.println("Row: " + row + " Path: " + path + " Node: " + tree.getLastSelectedPathComponent()); } });