You can develop Java GUI applications in Visual Studio Code easily. To achieve that, you need to install the Extension Pack for Java, which includes all the required extensions to develop Java GUI applications. Show Install the Extension Pack for Java If you run into any issues when using the features below, you can contact us by entering an issue. Develop JavaFX applicationsCreate a new JavaFX projectYou can create a new JavaFX application with just a few steps in VS Code:
Run the JavaFX application
To run the JavaFX application, you can open the Maven Explorer, expand
More JavaFX examplesMore JavaFX project examples can be found in the openjfx samples repository, which covers different project structures (such as Gradle and unmanaged folder projects). There is documentation on each sample to describe how to run the program. Develop AWT applicationsBy default, the types from the Abstract Window Toolkit (AWT) are hidden. You may notice that code completions are not working when you are developing an AWT application. To enable completions, you can open the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)) and then select the command Java: Help Center. Go to the Student section and select Enable AWT Development.
You can use the sample code below to run a simple Java AWT application in VS Code.
Develop Swing applicationsSwing application development is supported by default. You can directly write your Swing application code without any setup. |