Using JavaFX to pick a file from the local drive.
- Download and install OpenJDK 11 (LTS) from https://adoptopenjdk.net/ Press on your windows key or click the windows icon, then search for "path"
- Once the System Properties window is open, click on Environment Varaibles.
- Under System Varaibles, verify that there is a "JAVA_HOME" variable and it's set to "C:\Program Files\AdoptOpenJDK\jdk-11.x.x.xx-hotspot"
- Scroll down to the "Path" variable and double click it.
- Verify that the AdoptOpenJDK variable is above all other JDKs installed on your system.
- Click on ok and apply the new environment variable settings then close the System Properties window.
- Open a command prompt and type "where java"
- Verify that AdoptOpenJDK shows up on screen.
- Type "java --version"
- Verify that "openjdk 11.x.x" shows up on screen.
- Add the following dependencies to pom.xml
<dependencies>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-base -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-base</artifactId>
<version>11</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-controls -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-fxml -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>11</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-graphics -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>11</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-media -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-media</artifactId>
<version>11</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-swing -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-swing</artifactId>
<version>11</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-web -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>11</version>
</dependency>
</dependencies>- Go to https://gluonhq.com/products/scene-builder/ and download the Scene Builder installer for your operating system.
- Go to File > Settings > Plugins
- Install JavaFX Runtime for Plugins
- Right click on the resources folder and create a fxml file.
- Double click to open the fxml file.
- Near the bottom of the screen click on the tab for Scene Builder.
- When trying to open the Scene Builder for the first time, a warning will show near the top of the screen asking to install Scene Builder.