简体   繁体   English

我如何使用 JavaFX 框架?

[英]How I can use the JavaFX framework?

firstly, I want let you know how useful this community is for me, I was stuck on an error首先,我想让你知道这个社区对我有多大用处,我陷入了一个错误

`Error: JavaFX runtime components are missing, and are required to run this application`

and thanks to this answer I actually solved: link多亏了这个答案,我才真正解决了: 链接

However I've a couple of questions.不过我有几个问题。 I noticed that IntelliJ doesn't change the configurations (Like set the VM option and pick the right library for the javaFX project), so each time I've to create a new JavaFX11 or 12 project I've to being throw all the manually settings again.我注意到 IntelliJ 不会改变配置(比如设置 VM 选项并为 javaFX 项目选择正确的库),所以每次我必须创建一个新的 JavaFX11 或 12 项目时,我都必须手动抛出所有再次设置。 There's a way for set a "default behaviour" for the IDE ?有没有办法为 IDE 设置“默认行为”? It's really cumbersome.真的很麻烦。

The second question is, how I can use all the beautiful framework that the developer community offer for JavaFX?第二个问题是,我如何才能使用开发者社区为 JavaFX 提供的所有漂亮框架? I've seen on openjFX a couple of interesting framework like TilesFX or CalendarFX but there's no information on how implement them on my IDE neither on GitHub nor here.我在openjFX看到了一些有趣的框架,如 TilesFX 或 CalendarFX,但没有关于如何在我的 IDE 上实现它们的信息,无论是在 GitHub 上还是在这里。 I have seen that most of them uses Gradle files, but honestly I don't have the faintest idea of what this kind of file does and how implement it on IntelliJ.我已经看到他们中的大多数使用 Gradle 文件,但老实说,我对这种文件的作用以及如何在 IntelliJ 上实现它一无所知。 Thank's to everybody.谢谢大家。

Run the project with a more recent JDK like JDK11, for example.例如,使用更新的 JDK(如 JDK11)运行项目。

If it does'nt work, you probably forgot to change the JDK of your builder in IntelliJ!如果它不起作用,您可能忘记在 IntelliJ 中更改构建器JDK

Open the settings and follow the path as bellow:打开设置并按照以下路径操作:

FOR MAVEN 在此处输入图片说明

FOR GRADLE 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM