2 Replies Latest reply: Nov 3, 2012 10:15 AM by kapac RSS

    node problem

    kapac
      Hi;
      I don't understand in the node class the difference between the two methods
      isDisable() and isDisabled and also setDisable() and setDisabled() which seem similar to me
      regards
        • 1. Re: node problem
          James_D
          disable is a direct property of the node. You can set it with setDisable(...) or disableProperty().set(...). Setting it to true causes it, and all of its descendants to appear in a disabled state and not respond to user input.

          disabled is a read only property which specifies if the node behaves in a disabled state. That is, getDisabled() returns true if the disable property of the node *or any of its ancestors is set to true.

          So
          Pane pane = new Pane();
          Node node = new Button("Click me");
          pane.getChildren().add(node);
          
          node.setDisable(false);
          pane.setDisable(true);
          
          node.disabledProperty().get(); // is true
          node.disableProperty().get(); // is false
          The rendering and event handling is affected by the disabled property, so the button above would appear disabled and not respond to user input.
          • 2. Re: node problem
            kapac
            it's quite clear
            thank you