putree.addMouseListener(new MouseAdapter() { // 添加鼠标事件处理
@Override
public void mousePressed(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e)) { // 点击了鼠标左键
TreePath path = tree.getSelectionPath();
if(path != null) tree.expandPath(path);// 展开节点
} // End if
} // End mousePressed function
});