如何在JDK 13中创建JavaFX程序

时间:2019-10-17 07:00:54

标签: java intellij-idea javafx

自JDK 8起,我就使用JavaFX来开发具有出色UI组件的桌面应用程序。最近,我将JDK版本13下载到我的intellij IDEA,并开始通过Scene Builder应用程序开发一个小程序。我首先设置了场景构建器的路径,并创建了一个JavaFX项目,但是它不起作用。当我按下播放按钮时,显示以下错误

Error:(21, 9) java: cannot find symbol
  symbol:   method launch(java.lang.String[])
  location: class sample.Main
Error:(15, 35) java: cannot find symbol
  symbol:   class Scene
  location: class sample.Main
Error:(13, 39) java: cannot find symbol
  symbol:   method getClass()
  location: class sample.Main
Error:(13, 23) java: cannot find symbol
  symbol:   variable FXMLLoader
  location: class sample.Main
Error:(13, 9) java: cannot find symbol
  symbol:   class Parent
  location: class sample.Main
Error:(11, 5) java: method does not override or implement a method from a supertype
Error:(12, 23) java: cannot find symbol
  symbol:   class Stage
  location: class sample.Main
Error:(6, 20) java: package javafx.scene does not exist
Error:(9, 27) java: cannot find symbol
  symbol: class Application
Error:(7, 20) java: package javafx.stage does not exist
Error:(5, 20) java: package javafx.scene does not exist
Error:(3, 26) java: package javafx.application does not exist
Error:(4, 19) java: package javafx.fxml does not exist

为什么会这样, 我应该怎么做才能摆脱这些错误,并像以前在JDK 8中那样开发应用程序, JavaFX是否可以替代以创建基于UI的应用程序。

0 个答案:

没有答案