Tag: 桌面

无法运行JavaFX – Kotlin应用程序

我无法运行我的javafx – kotlin应用程序。 我的入门级 class Starter : Application() { override fun start(primaryStage: Stage?) { val root : Parent = FXMLLoader.load(javaClass.getResource(“view/main.fxml”)) primaryStage?.title = “Title” primaryStage?.scene = Scene(root) primaryStage?.show() } fun main(args: Array) { launch(args) } } 我不能将参数“参数”传递给“启动”方法,因为编译器说: 错误:(19,9)Kotlin:以下函数都不能用所提供的参数调用:public open fun launch(p0:Class !, vararg p1:String!):javafx.application.Application中定义的单位public open fun启动(vararg p0:String!):在javafx.application.Application中定义的单位 如果我试图调用“启动”方法没有参数我有以下例外 exception在线程“main”java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:43)at sun.launcher.LauncherHelper […]