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

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!!!

The Github Repo you can find here:

11 Likes

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

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

2 Likes

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?

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.

1 Like

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! :slight_smile:

download the flatlaf from 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.

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

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

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

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! :slight_smile:

1 Like

Very nice. Looking forward for the JPackage tutorial.

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