private void updateSelection(){
  TreePath selectionPath=tree.getSelectionPath();
  if (selectionPath != null) {
    Entry selectedEntry=(Entry)selectionPath.getLastPathComponent();
    if (!(selectedEntry instanceof Folder)) {
      tree.setSelectionPath(selectionPath.getParentPath());
    }
  }
}

private void updateSelection ( ) { TreePath selectionPath = tree . getSelectionPath ( ) ; if ( selectionPath != null ) { Entry selectedEntry = ( Entry ) selectionPath . getLastPathComponent ( ) ; if ( ! ( selectedEntry instanceof Folder ) ) { tree . setSelectionPath ( selectionPath . getParentPath ( ) ) ; } } }
updates the path selected via the tree .
