How to setup JavaFX
- Open Eclipse -> Help -> Eclipse Marketplace
- Search for "javafx"
- You'll see e(fx)eclipse, install it.
- After installation, restart eclipse
- Download JavaFX in here JavaFX (Click here to download JavaFX: https://gluonhq.com/products/javafx/)
- Extract the folder and place it downloads folder (or anyplace)
- Then in eclipse right click the project and select properties
- Choose Java Build Path
- Then select Libraries tab (you'll see tabs on the top)
- You'll see Classpath > JavaFX SDK
- Click on Classpath, then click Add external JARs from the right.
- Then from the download JavaFX (placed in downloads folder or somewhere you've placed).
- Choose all the .jars file in Downloads/javafx-sdk-11.0.2/lib/(all .jar(s) file) and click open.
- Then click Apply and Apply and close.
- Then you won't get red underlines or (error).
- Then right click on project > Run as > Run configuration
- Choose the arguments tab and type this in VM arguments. --module-path /path/to/JavaFX/lib --add-modules=javafx.controls,javafx.fxml REPLACE PATH TO WITH THE ACTUAL PATH
Video instructions: https://drive.google.com/file/d/1EDCUYnVZJgaTT8FmOtsTFBbUlNSz-Zhr/view?usp=sharing