Skip to content

Instantly share code, notes, and snippets.

@ajoydas
Created April 25, 2017 09:18
Show Gist options
  • Save ajoydas/8e08af85b0d7fe4a82a05f54faefb030 to your computer and use it in GitHub Desktop.
Save ajoydas/8e08af85b0d7fe4a82a05f54faefb030 to your computer and use it in GitHub Desktop.
public void mouseClicked(MouseEvent mouseEvent) {
FilePathTreeItem item = (FilePathTreeItem) treeView.getSelectionModel().getSelectedItem();
System.out.println(item.getAbsolutePath());
showItems(item);
}
public class FilePathTreeItem extends TreeItem<String>{
private final File file;
@Override
public ObservableList<TreeItem<String>> getChildren(){
//System.out.println("Getting Children for "+file.toString());
if(isFirstTimeChildren){
isFirstTimeChildren=false;
super.getChildren().setAll(buildChildren(this));
}
return(super.getChildren());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment