title: IllegalStateException not caught
body: <p>i want to catch an IllegalStateException in Scala. Following code</p>
  
  <pre><code>val scene = new SceneDock
  </code></pre>
  
  <p>throws an IllegalStateException if an JavaFX-Application was not started before. This constructor is from the JemmyFX framework.</p>
  
  <p>So i want to catch this Exception in the following way:</p>
  
  <pre><code>try{
   val scene = new SceneDock
   "running"}
  catch{
   case e: IllegalStateException =&gt; { "stopped" } }
  </code></pre>
  
  <p>But it doesn't work. The output is always the IllegalStateException: Toolkit not initialized  and it repeates until i terminate the application. Have already tried to catch Exception, and tried it with Java, but always the same result.</p>
  
  <p>stack trace (it repeads until i terminate the app):</p>
  
  <pre><code>java.lang.IllegalStateException: Toolkit not initialized
  at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:155)
  at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:150)
  at javafx.application.Platform.runLater(Platform.java:52)
  at org.jemmy.fx.QueueExecutor.executeQueue(QueueExecutor.java:98)
  at org.jemmy.action.AbstractExecutor.execute(AbstractExecutor.java:100)
  at org.jemmy.fx.SceneList.getControls(SceneList.java:58)
  at org.jemmy.lookup.PlainLookup.getChildren(PlainLookup.java:76)
  at org.jemmy.lookup.AbstractLookup.refresh(AbstractLookup.java:172)
  at org.jemmy.lookup.AbstractLookup$1.reached(AbstractLookup.java:141)
  at org.jemmy.lookup.AbstractLookup$1.reached(AbstractLookup.java:137)
  at org.jemmy.timing.Waiter.waitState(Waiter.java:78)
  at org.jemmy.timing.Waiter.ensureState(Waiter.java:119)
  at org.jemmy.lookup.AbstractLookup.wait(AbstractLookup.java:137)
  at org.jemmy.lookup.AbstractLookup.get(AbstractLookup.java:250)
  at org.jemmy.lookup.AbstractLookup.wrap(AbstractLookup.java:210)
  at org.jemmy.dock.Dock.lookup(Dock.java:75)
  at org.jemmy.fx.SceneDock.&lt;init&gt;(SceneDock.java:20)
  at org.jemmy.fx.SceneDock.&lt;init&gt;(SceneDock.java:32)
  at org.jemmy.fx.SceneDock.&lt;init&gt;(SceneDock.java:60)
  at org.djemmysl.main.DjemmySL$class.applicationStatus(DjemmySL.scala:25)
  at org.djemmysl.main.Main$.applicationStatus(Main.scala:3)
  at org.djemmysl.main.Main$.main(Main.scala:6)
  at org.djemmysl.main.Main.main(Main.scala)
  
  java.lang.IllegalStateException: Toolkit not initialized
  at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:155)
  at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:150)
  at javafx.application.Platform.runLater(Platform.java:52)
  at org.jemmy.fx.QueueExecutor.executeQueue(QueueExecutor.java:98)
  at org.jemmy.action.AbstractExecutor.execute(AbstractExecutor.java:100)
  at org.jemmy.fx.SceneList.getControls(SceneList.java:58)
  at org.jemmy.lookup.PlainLookup.getChildren(PlainLookup.java:76)
  at org.jemmy.lookup.AbstractLookup.refresh(AbstractLookup.java:172)
  at org.jemmy.lookup.AbstractLookup$1.reached(AbstractLookup.java:141)
  at org.jemmy.lookup.AbstractLookup$1.reached(AbstractLookup.java:137)
  at org.jemmy.timing.Waiter.waitState(Waiter.java:78)
  at org.jemmy.timing.Waiter.ensureState(Waiter.java:119)
  at org.jemmy.lookup.AbstractLookup.wait(AbstractLookup.java:137)
  at org.jemmy.lookup.AbstractLookup.get(AbstractLookup.java:250)
  at org.jemmy.lookup.AbstractLookup.wrap(AbstractLookup.java:210)
  at org.jemmy.dock.Dock.lookup(Dock.java:75)
  at org.jemmy.fx.SceneDock.&lt;init&gt;(SceneDock.java:20)
  at org.jemmy.fx.SceneDock.&lt;init&gt;(SceneDock.java:32)
  at org.jemmy.fx.SceneDock.&lt;init&gt;(SceneDock.java:60)
  at org.djemmysl.main.DjemmySL$class.applicationStatus(DjemmySL.scala:25)
  at org.djemmysl.main.Main$.applicationStatus(Main.scala:3)
  at org.djemmysl.main.Main$.main(Main.scala:6)
  at org.djemmysl.main.Main.main(Main.scala)
  </code></pre>