Developers have many options for building Java desktop applications. Originally, AWT and Swing provided native desktop application user interfaces, but today the standard for Java desktop user interface development is JavaFX. JavaFX offers a rich, robust API. You can find countless tutorials and reference material on JavaFX with a quick online search.
The best thing about modern Java desktop development is the introduction of the modularized JDK and associated tools such as jdeps, jlink, and jpackage. These tools allow you to create a complete, native desktop installation package with a highly slimmed down Java runtime. For example, a complete installable macOS .dmg or Windows .msi "Hello World" JavaFX application is only roughly 30mb in size - a fraction of the size of a standard Electron application.
With Zadt, by adding just a few lines to the Maven or Gradle build, you can easily add auto-update, crash-reporting, and analytics to your application!
Java Desktop Service Applications
Web User Interface, Local Native Application
In addition to standard Java desktop applications, you can also build Java service applications. These applications use standard Java development web technologies - for example, Spring Boot, Thymeleaf, or GWT - to create a user interface for an application that runs as a background service. An example of this development model is an application like Plex - it's a media streamer that runs on a local computer, but offers a web UI accessible to devices on the local network.
In this scenario, the application is packaged as a native installer, runs at startup, and the user accesses the UI by clicking on items in the system tray (the icons in the upper-left menu bar on macOS and lower-right task bar on Windows). These applications typically default to local system access only by default, and then may (or may not) offer mechanisms to offer network services to other devices.