How to create a JavaFX Maven project in IntelliJ IDEA?

前端 未结 5 1878
花落未央
花落未央 2021-02-04 01:58

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 pro

5条回答
  •  春和景丽
    2021-02-04 02:20

    This steps worked for me (Is a different process): 1. Create a maven project. 2. In the generated pom.xml add the following:

    `
            
                
                    com.zenjava
                    javafx-maven-plugin
                    8.7.0
                    
                        your.package.with.mainclass
                    
                
            
        `
    

    This adds a maven plugin for javafx (more info: https://github.com/javafx-maven-plugin/javafx-maven-plugin)

    1. Create in your resources folder your sample.fxml
    2. Create your controller class for sample.fxml and link
    3. Enjoy!

提交回复
热议问题