# A Java Swing Desktop application written with Netbeans using the FlatLaf look and feel

**URL:** <https://ifnotnil.com/t/a-java-swing-desktop-application-written-with-netbeans-using-the-flatlaf-look-and-feel/4160>\
**Category:** Java\
**Tags:** tutorials\
**Created:** [30 October 2024 06:32 UTC](https://ifnotnil.com/t/a-java-swing-desktop-application-written-with-netbeans-using-the-flatlaf-look-and-feel/4160 "2024-10-30T06:32:29Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![thorstenstueker](https://ifnotnil.com/letter_avatar_proxy/v4/letter/t/aca169/32.png) [@thorstenstueker](https://ifnotnil.com/u/thorstenstueker)\
**Post date:** [30 October 2024 06:32 UTC](https://ifnotnil.com/t/a-java-swing-desktop-application-written-with-netbeans-using-the-flatlaf-look-and-feel/4160/1 "2024-10-30T06:32:30Z")

</div>

In this youtube Video I describe how to write a platform independent Java Swing application with FlatLaf look and Feel. In less than a quarter of an hour I am writing a small application with a Textarea to edit content and a Write and a read Button to write and read the File and also an exit button.

One Correction: not a Web but a Desktop application. Web comes later. Dunno why but it was really late!!!

[![](https://img.youtube.com/vi/Tmx89UYViD0/maxresdefault.jpg "Java Swing Application with Flatlaf written with Netbeans 23") ](https://www.youtube.com/watch?v=Tmx89UYViD0)

The Github Repo you can find here:

> **[GitHub - thorstenstueker/SwingExample: Java Swing Repo for Tutorial](https://github.com/thorstenstueker/SwingExample)**
>
> Java Swing Repo for Tutorial

---

<div class="post-metadata">

**Author:** ![HalGumbert](https://ifnotnil.com/user_avatar/ifnotnil.com/halgumbert/32/2198_2.png) [@HalGumbert](https://ifnotnil.com/u/HalGumbert)\
**Post date:** [30 October 2024 12:20 UTC](https://ifnotnil.com/t/a-java-swing-desktop-application-written-with-netbeans-using-the-flatlaf-look-and-feel/4160/2 "2024-10-30T12:20:50Z")

</div>

Thank you! I’m gonna try that this weekend. 🙂

---

<div class="post-metadata">

**Author:** ![thorstenstueker](https://ifnotnil.com/letter_avatar_proxy/v4/letter/t/aca169/32.png) [@thorstenstueker](https://ifnotnil.com/u/thorstenstueker)\
**Post date:** [30 October 2024 13:03 UTC](https://ifnotnil.com/t/a-java-swing-desktop-application-written-with-netbeans-using-the-flatlaf-look-and-feel/4160/3 "2024-10-30T13:03:55Z")

</div>

I will provide later also a Codenameone Example for mobile apps and a vaadin example for webapps

---

<div class="post-metadata">

**Author:** ![HalGumbert](https://ifnotnil.com/user_avatar/ifnotnil.com/halgumbert/32/2198_2.png) [@HalGumbert](https://ifnotnil.com/u/HalGumbert)\
**Post date:** [31 October 2024 14:25 UTC](https://ifnotnil.com/t/a-java-swing-desktop-application-written-with-netbeans-using-the-flatlaf-look-and-feel/4160/4 "2024-10-31T14:25:08Z")

</div>

Very nice! Just watched the video and while that’s all new to me, it makes sense and is familiar!

Do you prefer NetBeans over IntelliJ IDEA?

---

<div class="post-metadata">

**Author:** ![thorstenstueker](https://ifnotnil.com/letter_avatar_proxy/v4/letter/t/aca169/32.png) [@thorstenstueker](https://ifnotnil.com/u/thorstenstueker)\
**Post date:** [31 October 2024 14:40 UTC](https://ifnotnil.com/t/a-java-swing-desktop-application-written-with-netbeans-using-the-flatlaf-look-and-feel/4160/5 "2024-10-31T14:40:26Z")

</div>

Netbeans contains the UI Designer. IntelliJ can have an UI Designer when installing JFormDesigner, it’s a plugin which costs 30 per year. Netbeans is completely for free.

I am using both IDE’s. I prefere Netbeans for Desktop-Projects with Java Swing. Definitely, while the Drag and Drop UI Designer is really nice.

Why I am preferring Swing for the UI? While the jar File can run without any changes on Windows, MacOS and Linux. On all platforms runnable with java -jar nameoftejar.jar

That makes it for me simple to test the app on all platforms before I am starting to build my jPackage for the platforms and deploy the Software to Customers. Internally we even use jars directly as program files while we even are too lacy to build Packages. And while it works without any problem.

---

<div class="post-metadata">

**Author:** ![HalGumbert](https://ifnotnil.com/user_avatar/ifnotnil.com/halgumbert/32/2198_2.png) [@HalGumbert](https://ifnotnil.com/u/HalGumbert)\
**Post date:** [31 October 2024 15:07 UTC](https://ifnotnil.com/t/a-java-swing-desktop-application-written-with-netbeans-using-the-flatlaf-look-and-feel/4160/6 "2024-10-31T15:07:09Z")

</div>

So far I installed JDK and NetBeans. Then downloaded your GitHub Project.

JDK `https://www.oracle.com/java/technologies/downloads/`  
NetBeans `https://netbeans.apache.org/front/main/`

When I opened the project it seemed to have less items in the project. And when I run it I get:  
`Exception in thread "main" java.lang.RuntimeException: Uncompilable code - exception javax.swing.UnsupportedLookAndFeelException is never thrown in body of corresponding try statement at swingexample.SwingExample.main(SwingExample.java:1)`

Should I be able to download the project and just hit run?

Thanks for your patience! 🙂

---

<div class="post-metadata">

**Author:** ![thorstenstueker](https://ifnotnil.com/letter_avatar_proxy/v4/letter/t/aca169/32.png) [@thorstenstueker](https://ifnotnil.com/u/thorstenstueker)\
**Post date:** [31 October 2024 15:15 UTC](https://ifnotnil.com/t/a-java-swing-desktop-application-written-with-netbeans-using-the-flatlaf-look-and-feel/4160/7 "2024-10-31T15:15:53Z")

</div>

download the flatlaf from [formdev.com](http://formdev.com) and then import it like I sowed in the video while I was not delivering it with. I was not placing it as file in project but as link

lao. setup in your project properties the right java version.

---

<div class="post-metadata">

**Author:** ![HalGumbert](https://ifnotnil.com/user_avatar/ifnotnil.com/halgumbert/32/2198_2.png) [@HalGumbert](https://ifnotnil.com/u/HalGumbert)\
**Post date:** [31 October 2024 15:43 UTC](https://ifnotnil.com/t/a-java-swing-desktop-application-written-with-netbeans-using-the-flatlaf-look-and-feel/4160/8 "2024-10-31T15:43:05Z")

</div>

When you add a jar, do you have to give permissions in Mac OS? Every time I add the jar, it doesn’t actually add it.

I downloaded from:  
“[https://repo1.maven.org/maven2/com/formdev/flatlaf/3.5.2/flatlaf-3.5.2.jar](https://repo1.maven.org/maven2/com/formdev/flatlaf/3.5.2/flatlaf-3.5.2.jar)”

---

<div class="post-metadata">

**Author:** ![thorstenstueker](https://ifnotnil.com/letter_avatar_proxy/v4/letter/t/aca169/32.png) [@thorstenstueker](https://ifnotnil.com/u/thorstenstueker)\
**Post date:** [31 October 2024 16:13 UTC](https://ifnotnil.com/t/a-java-swing-desktop-application-written-with-netbeans-using-the-flatlaf-look-and-feel/4160/9 "2024-10-31T16:13:16Z")

</div>

depends on our permissions of your computer  
if you have write permissions it will work without any problem. I was adding it without the need of giving permissions and tested on McOs, Windows and Linux

just done it again on my Office Mac

 ![grafik](https://ifnotnil.com/uploads/default/original/2X/a/a80f9e088dd31713684aac44ad1218a62cf1666b.png)

and it was dded without any problem, project was running after setting the Java Platform in project Settings

---

<div class="post-metadata">

**Author:** ![HalGumbert](https://ifnotnil.com/user_avatar/ifnotnil.com/halgumbert/32/2198_2.png) [@HalGumbert](https://ifnotnil.com/u/HalGumbert)\
**Post date:** [31 October 2024 16:20 UTC](https://ifnotnil.com/t/a-java-swing-desktop-application-written-with-netbeans-using-the-flatlaf-look-and-feel/4160/10 "2024-10-31T16:20:34Z")

</div>

> [@thorstenstueker](#):
>
> depends on our permissions of your computer

Thanks!

That did the trick. I made a folder, but everything in it and applied the folder permissions down.

Interesting that I don’t usually have to do that.

It now runs! 🙂

---

<div class="post-metadata">

**Author:** ![cm\_rb](https://ifnotnil.com/letter_avatar_proxy/v4/letter/c/977dab/32.png) [@cm\_rb](https://ifnotnil.com/u/cm_rb)\
**Post date:** [31 October 2024 21:00 UTC](https://ifnotnil.com/t/a-java-swing-desktop-application-written-with-netbeans-using-the-flatlaf-look-and-feel/4160/11 "2024-10-31T21:00:58Z")

</div>

Very nice. Looking forward for the JPackage tutorial.

---

<div class="post-metadata">

**Author:** ![tkaltschmidt](https://ifnotnil.com/letter_avatar_proxy/v4/letter/t/ce7236/32.png) [@tkaltschmidt](https://ifnotnil.com/u/tkaltschmidt)\
**Post date:** [23 November 2024 21:42 UTC](https://ifnotnil.com/t/a-java-swing-desktop-application-written-with-netbeans-using-the-flatlaf-look-and-feel/4160/12 "2024-11-23T21:42:48Z")

</div>

Thank you, Thorsten! Very nice explanation, without blabla!

---

<div class="post-metadata">

**Author:** ![tkaltschmidt](https://ifnotnil.com/letter_avatar_proxy/v4/letter/t/ce7236/32.png) [@tkaltschmidt](https://ifnotnil.com/u/tkaltschmidt)\
**Post date:** [7 January 2025 19:44 UTC](https://ifnotnil.com/t/a-java-swing-desktop-application-written-with-netbeans-using-the-flatlaf-look-and-feel/4160/13 "2025-01-07T19:44:01Z")

</div>

Any chance this will be continued?

---

<div class="post-metadata">

**Author:** ![thorstenstueker](https://ifnotnil.com/letter_avatar_proxy/v4/letter/t/aca169/32.png) [@thorstenstueker](https://ifnotnil.com/u/thorstenstueker)\
**Post date:** [7 January 2025 19:56 UTC](https://ifnotnil.com/t/a-java-swing-desktop-application-written-with-netbeans-using-the-flatlaf-look-and-feel/4160/14 "2025-01-07T19:56:17Z")

</div>

Yes I am working on it at this weekend. Then we will have it.
