title: Kotlin. Basic JavaFX application
body: <p>Trying out Kotlin lang and I had an impression that it is compatible with Java and therefore with JavaFX and i tried following:</p>
  
  <pre><code>public object TestKt: Application() {
  
      public override fun start(stage: Stage){
          val pane= Pane()
          val scene=Scene(pane,200.0,200.0)
          stage.scene = scene
          stage.show()
  
      }
      @JvmStatic public fun main(args: Array&lt;String&gt;){
          launch()
      }
  }
  </code></pre>
  
  <p>this is basically same as Java's</p>
  
  <pre><code>public class Test extends Application {
      @Override
      public void start(Stage stage)  {
          Pane pane=new Pane();
          Scene scene=new Scene(pane, 200,200);
          stage.setScene(scene);
          stage.show();
      }
      public static  void  main(String[] args){
          launch();
      }
  }
  </code></pre>
  
  <p>but Kotlin gives an error: Exception in thread "main" java.lang.RuntimeException: Unable to construct Application instance: class Test</p>