title: Do you know method to get the JavaFX Text node of a TextArea without using the CSS properties?
body: <p>I wish to find a method to get the Text node of a TextArea without using the CSS properties. The Text node of JavaFX exposes the method setUnderline(boolean) 
  through which I can set the underline property of a TextArea; the TextArea, instead, doesn't expose the same method. In addition, the TextArea.getText() method returns a String instead of a Text object.
  So, I solved the problem as follow:
  In the code,</p>
  
  <pre><code>// Fields..
  private final PseudoClass pseudoClass = PseudoClass.getPseudoClass("underlined");
  private final SimpleBooleanProperty underlinedProperty = new SimpleBooleanProperty(false);
  private final TextArea textArea = new TextArea();
  
  [...]
  
  // In a method (ex. in the constructor)..
  {
      textArea.setId("textArea"); 
      underlinedProperty.addListener(new ChangeListener&lt;Boolean&gt;() {
          @Override
          public void changed(ObservableValue&lt;? extends Boolean&gt; observable, Boolean oldValue, Boolean newValue) {
              Node node = textArea.getScene().lookup("#textArea .text");  
              node.pseudoClassStateChanged(pseudoClass, newValue);
          }
      });
  }
  
  [...]
  
  // The class exposes the getter method for the underlinedProperty
  public SimpleBooleanProperty getUnderlinedProperty() {
      return underlinedProperty;
  }
  </code></pre>
  
  <p>Now, I've create a CSS sheet with this code:</p>
  
  <pre><code>#textArea .text {
      /* some styles */
      -fx-underline: false;
  }
  
  #textArea .text:underlined {
      -fx-underline: true;
  }
  </code></pre>
  
  <p>Finally, the above class is called in some other classes:</p>
  
  <pre><code>{
      'handleOfClassInPoint1'.getUnderlineProperty().set(true); // or false
  }
  </code></pre>
  
  <p>The problem is the lookup() method: this method returns a not null value only if all the fx nodes were created, i.e. only after some graphical result.
  I wish to find a procedure to set the underline property of a TextArea without using CSS (ex. a toggle button manages the underline property: the text of a TextArea is underlined if the toggle is selected).
  Anyone can help me?
  Thank you so much!</p>