How do I use JavaFX 11 in Eclipse?

后端 未结 3 965
花落未央
花落未央 2021-01-02 04:46

I have some trouble with JavaFX. I wanted to start creating apps, desktop or mobile, at least something. So I found out I could use the JavaFX library for it. But as far as

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-02 05:11

    I've had to struggle through this on about 20 computers now, so I made the following checklist:

    [ ] download javafx11 from javafx11's website, put on desktop
    [ ] create a MODULE based project
    [ ] right click project, go to BUILD PATH
    [ ] add the downloaded javafx.base/control/graphics as external jar files
    [ ] put the files in a package (eg: my_big_package)
    [ ] put the following in the module.java file:
    module javafx11 {
        requires javafx.controls;
        exports my_big_package;
    }
    [ ] eat a donut from the break room
    

    If you're not married to Eclipse and/or just trying to learn (or are a student with an unhelpful professor/TAs), BlueJ currently has JavaFX already built into it and ready to go, so no extra setup or download is necessary. Neat!

提交回复
热议问题