Setting up everything to build a Java desktop app can easily take several hours. But what if, with a single prompt, a good LLM, and a simple blueprint, you could have the whole project ready in minutes?

In this article, I will show you how I made this possible and walk you through the exact steps I have done using Cursor with Claude 4 Sonnet.

Our motivation 

Before we dive in, I want you to understand what drove us in the first place. Recently, I built a desktop demo app for another article titled “Java desktop app with Shadcn UI”. It was a fairly involved process, and we quickly realized that making similar demos for other purposes would mean writing the same boilerplate code and repeating the same setup steps over and over.

We wanted a way to scaffold such demo apps instantly. That’s when we asked ourselves: what if we used LLMs and AI-powered IDEs to handle it for us?

How we did it 

I started with the existing demo app from the earlier work. I fed that project to the LLM and asked it to create an architecture overview. In that overview, it described the stack we use — Protobuf/gRPC, shadcn/ui, React, and JxBrowser — along with the directory structure and how all the pieces fit together.

I also had it explain how the communication layer works between Java and the web frontend. That document became the blueprint the LLM could follow to generate a new app from a single prompt.

Challenges along the way 

Of course, it wasn’t as simple as feeding the blueprint document to the LLM and hitting “go”. I have experienced a bunch of issues and inconsistencies when generating the project with LLM.

  • It didn’t know how to work with the JxBrowser API, especially when configuring the network layer with InterceptUrlRequestCallback, so I had to guide it using documentation and working code samples.
  • It struggled with Tailwind 4, defaulting to older setups — a common issue I have seen when LLMs deal with newer library versions.
  • Configuring the CORS policy for the Armeria gRPC server was another sticking point, and again, I had to provide a correct example.
  • It often mixed up dependency versions, which led to compile-time and runtime errors.
  • It regularly messed up imports — either omitting them or completely making them up — which caused compilation failures.
  • It couldn’t set up a proper Gradle project structure on its own, so I supplied a set of base files to bootstrap from.

I fixed these and other minor issues iteratively. Each time generating a new version of the project from the architecture overview, I addressed whatever was broken or unclear and refined the document until I had a stable, working setup that could reliably generate these kinds of demos.

The result 

The stable setup we ended up with is a compact set of files you can use to scaffold your own Java desktop app with a React-based UI. To try it yourself, download the docs and template directories from this GitHub directory and put them into an empty project.

Once you have the files, add the architecture-overview.md document to the context for a new project in Cursor, then ask the LLM to generate the app.

App from the prompt

Screenshot of the prompt in Cursor.

Here’s the prompt to use:

Please read and analyse the architecture in architecture-overview.md we've used
in our previous project, and let's create a new demo project from it.

Let's create a simple desktop application with the functionality of a basic
file system viewer. The front-end part will be responsible for displaying the
file system structure, like folders and files. The backend part will access the
Java file system API and provide the data to the front-end.

When all the project files are generated, you can start the app by first running the Vite dev server:

npm run dev

Then, in another terminal, launch the application itself:

./gradlew run

You should see the desktop app window with shadcn/ui (React) that allows viewing local files/folders and navigating through them:

App from the prompt

Screenshot of the desktop app generated from the prompt.

Here’s the video demonstrating the whole process of building the Java app from scratch:

Conclusion 

You can use this approach to scaffold similar projects for your own purposes. If you need assistance with setup or have any questions, please don’t hesitate to contact us at .

Spinner

Sending…

Sorry, the sending was interrupted

Please try again. If the issue persists, contact us at info@teamdev.com.

Read and agree to the terms to continue.

Your personal JxBrowser trial key and quick start guide will arrive in your Email Inbox in a few minutes.