请看getLastPathComponent方法的说明:
public Object getLastPathComponent()
Returns the last component of this path. For a path returned by DefaultTreeModel this will return an instance of TreeNode.
Returns:
the Object at the end of the path
See Also:
TreePath(Object[])