Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javafx 2 TreeView - hide root item

I created my own TreeView in JavaFX 2 with this tutorial. However I want to hide my root node.

How it looks like right now:

  • Root element
    • Parent 1
      • Child 1
      • Child 2
    • Parent 2
      • Child 1

How it should look:

  • Parent 1
    • Child 1
    • Child 2
  • Parent 2
    • Child 1

thanks, Muki

like image 919
Muki Avatar asked Jul 20 '12 12:07

Muki


1 Answers

Hiding the root item can be done by

treeView.setShowRoot(false);
like image 63
Uluk Biy Avatar answered Oct 15 '22 09:10

Uluk Biy