title: How to show a loading-animation in javafx-application?
body: <p>I just try to show a loading-animation while I access an ERP in my code like this:</p>
  
  <pre><code>protected void submit()
  {
      messageField.getStyleClass().add("smallLoading");
  
      submitImpl();
      messageField.getStyleClass().remove("smallLoading");
  }
  </code></pre>
  
  <p>Sadly the animation is never shown... Just the result as before. I tried using <code>Platform.runLater</code>, which yielded the same result. I also transfered the last 2 lines in a Thread, which worked (the animation was shown), but lead to the error "Not on FX application thread", when the Submitter tried to write to my message-field. When I passed the Thread to <code>Platform.runLater</code> it did not show the animation... I googled a little bit, but could not find a solution. Maybe I'm missing something important...</p>
  
  <p>I appreciate any help. Thank you!</p>