title: JavaFX TitledPane lookup(.title) returns null
body: <p>I'm new to Java FX and am creating an application for fun.  I'm trying to add a <code>TitledPane</code> dynamically and am getting Null Pointer Exceptions when attempting to lookup the title of the <code>TitledPane</code> about 70% of the time.  I tried to create a simple demo of my issue, but was unable to reproduce the issue outside of my application, but I could solve my issue.  I'm hoping someone could help me understand why my solution works and maybe point me in the direction of a better solution.  I'm using an FXML file with a Controller.  I'm attempting to lookup the title inside of Platform.runLater() because I'm manually editing the layout and elements of the title.  Inside of the Controller's initialize function, I do the following to get null pointer exceptions:</p>
  
  <pre><code>Platform.runLater(new Runnable() {
      @Override
      public void run() {
          titledpane.lookup(".title"); // will return null about 70% of the time
      }
  });
  // Do more stuff
  </code></pre>
  
  <p>However, if I wrap that call in a timer and execute it in 500 ms, it doesn't seem to ever return Null.</p>
  
  <pre><code>new java.util.Timer().schedule(new java.util.TimerTask() {
      @Override
      public void run() {
          Platform.runLater(new Runnable() {
              @Override
              public void run() {
                  titledpane.lookup(".title"); // doesn't seem to return null
              }
          });
      }
  }, 500);
  </code></pre>
  
  <p>One forum mentioned that CSS had to be applied to the element prior to calling a lookup on the title, so I tried manually applying CSS to the title, but <code>titledpane.lookup(".title")</code> still returned null.  Can anyone help me understand what is happening here?  Thanks in advance!</p>