Is there any solution to disable a node in javaFX without disabling its children ? I want to disable all nodes in a pane except one of them dynamically. I tried this solution and other solutions like this but doesn't work and i also think it has bad performance!
node.getParent().requestFocus();
for(int i=0 ; i<pane.getChildren().size() ; i++){
if( !pane.getChildren().get(i).isFocused()){
pane.getChildren().get(i).setDisable(true);
}
}
Edited:
also i tried this solution: I added a transparent pane to main pain and then add special node to it . But it doesb't work for complex components because I should keep sizes and locations of it's children !
I exactly want that user interact with one node of whole scene and other nodes should be disable .
The current javadoc of BooleanProperty disableProperty() of Node says: "...... Setting disable to true will cause this Node and any subnodes to become disabled.......
https://docs.oracle.com/javase/8/javafx/api/javafx/scene/Node.html#setDisable-boolean-
https://docs.oracle.com/javase/8/javafx/api/javafx/scene/Node.html#disableProperty
So you cannot disable one Node without its children.