JavaFX Project Structure

旧巷老猫 提交于 2019-12-02 18:16:41

IMHO, you shouldn't create package's depending on your views.

My approach towards such applications

  • A package for corresponding controllers of these views
  • Different packages for service(business) and dao(persistence) layer, if exists
  • A directory for resources such as images, css etc
  • A directory for FXML files called view in the resources

    src/main
      ├──java
         ├── controllers
            ├──Screen1controller.java
            ├──Screen2controller.java
         ├── service
            ├──Service1.java
         ├── dao(persist)
            ├── SaveProducts.java
      ├──resources
         ├──view
            ├──screen1.fxml
            ├──screen2.fxml
         ├──css
            ├──style.css
         ├──images
            ├──img1.jpg
            ├──img2.jpg
    

The above implementation can be considered for a Maven project.

For a simple project, you can view a structure here. It is a maven project!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!