如何在IntelliJ IDEA中创建JavaFX Maven项目? [英] How to create a JavaFX Maven project in IntelliJ IDEA?

查看:1192
本文介绍了如何在IntelliJ IDEA中创建JavaFX Maven项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在IntelliJ IDEA中从头开始打开JavaFX Maven项目?由于Java项目和JavaFx项目之间没有区别,我想打开一个包含Maven模块的专用JavaFX项目(从创建项目向导中选择JavaFX)。

How can I open a JavaFX Maven project from scratch in IntelliJ IDEA? As there is no difference between a Java project and a JavaFx project, I want to open a dedicated JavaFX project (Selection JavaFX from create project Wizard) with Maven module included.

推荐答案

虽然约会我正在回答这个问题,因为我最近有同样的问题而且有太多人告诉我写自己的pom虽然这在技术上是正确的,但如果你不小心,它会造成更多麻烦。

Although dated I'm answering this because I had the same question recently and too many people told me to write my own pom file etc. While that is technically true, it can create more headaches if you aren't careful.

我建议你:


  1. 像往常一样创建一个JavaFX项目。

  2. 确保项目视图(项目结构侧工具窗口中的下拉列表)设置为项目(否则第4步中的选项将不可见)

  3. 然后一旦打开并准备好右键单击项目文件夹

  4. 转到添加框架支持...。

  5. 选中Maven的复选框,然后单击确定。

  1. Create a JavaFX project as you normally would.
  2. Make sure that project view (dropdown in project structure side tool window) is set to 'Project' or 'Packages' (otherwise option in 4th step will not be visible)
  3. Then once it is opened and ready right click on the project folder
  4. Go to "Add Framework Support...".
  5. Check the box for Maven and click "OK".

让IntelliJ在此时为您完成工作。

Let IntelliJ do the work for you at this point.

As用于编辑FXML文件将IDEA链接到SceneBuilder。 此处是官方文档。但基本上:

As for editing FXML files link the IDEA to SceneBuilder. Here is the official documentation. But basically:


  1. 安装 Scene Builder

  2. 文件 - >设置 - >语言&框架 - > JavaFX

  3. 指向exe文件。

使用:右键单击FXML文件并选择Open In SceneBuilder(从底部开始)

To Use: Right click on the FXML file and select "Open In SceneBuilder" (way down at the bottom)

这篇关于如何在IntelliJ IDEA中创建JavaFX Maven项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆