Skip to main content

How to get tree node/cell selection data?

1 reply [Last post]
Joined: 2007-12-17

How to get which cell in the tree is selected? Can I get the 'text' element of the tree cell that is selected? If not, what information exactly can be retrieved and how?

Basically, I need to have a tree in a left pane and based on which node is selected I need to draw a certain Widget in the right pane. What is the way to do that with JavaFX?

A quick answer would be very much appreciated, as we are trying out a prototype and I need to get to a solution on this by next day.

I am using NetBeans 6.0. Is that the right environment? I have tried to see the JavaFX API page But it does not have much help on this.


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2007-01-11

Add a trigger that detects when the tree cell selection changes.

trigger on TreeCell.selected = value {
if (value == true) {
println("Selected cell is {text}");