This template is made for directly writing small sandbox programs with JavaFX in Visual Studio Code.
- Java development without build tool problems in VSCode
- Loading and opening SceneBuilder files
- Setup script for linking the correct packages in the project
- Ready configured launch script
- Debug Java in VSCode
- Extensions recommendations
People who are forced to work with Java and use GUI in small sandbox projects. But don't want to use horrible SDKs like Swing for that and at the same time don't want to leave their comfort in VSCode.
People who seriously want to write whole programs in Java and export them as well. They should rather struggle with some build tool.
-
Makes sure, you have Java installed
-
Download JavaFX and extract it somewhere safe
-
Create a environment variable called
$PATH_TO_FX
for your path to your JavaFXlib
foldere.g. on linux/mac
export PATH_TO_FX=path/to/javafx-sdk-15.0.1/lib
-
Clone the template (in your projects folder)
git clone https://github.com/b3ngg/vscode-javafx-template.git my_app
-
Navigate into your new app
cd my_app
-
Run the setup script to automatically link the SDKs
fx_path=$PATH_TO_FX node setup
-
Open the project in VSCode
code .
-
(Optional) Install recommended extensions
-
Possibly wait a few seconds for the extensions to settle down to life. You may have to reload the window the first time.
-
Press
F5
to launch your application
You can now write your application inside the src
directory and edit the scene.fxml
with the SceneBuilder.