Scala + JavaFXデスクトップアプリケーションを構築するためのガイドやチュートリアルはありますか?
良いソースを見つけるのに苦労していて、IDEとしてIntelliJIDEAを使用しています。
最も単純なデスクトップのHelloWorldサンプルでさえ、どこから始めればよいかわからないため、大いに役立ちます。
更新:これは私が今持っているものです:
import javafx.application.Application
import javafx.scene.Scene
import javafx.scene.layout.StackPane
import javafx.stage.Stage
import javafx.scene.control.Label
class Test extends Application {
override def start(primaryStage: Stage) {
primaryStage.setTitle("Sup!")
val root = new StackPane
root.getChildren.add(new Label("Hello world!"))
primaryStage.setScene(new Scene(root, 300, 300))
primaryStage.show()
}
}
object Test {
def main(args: Array[String]) {
val t = new Test
t.start(new Stage)
}
}
それを実行すると、次のようになります。
スレッド"main"の例外java.lang.IllegalStateException:FXアプリケーションスレッドではありません。currentThread = main
ラベル付きのHelloWorldウィンドウを表示するにはどうすればよいですか?