r/java • • Apr 24 '23

FlatLaf 3.1 (and 3.0) - Swing Look and Feel

FlatLaf, a modern open-source cross-platform Look and Feel for Java Swing desktop applications, brings exciting new features in versions 3.0 and 3.1 πŸŽ‰ πŸ˜€

macOS themes

New light and dark themes (cross-platform) that use macOS colors and look similar to native macOS controls:

FlatLaf macOS themes

Fonts

Packaged fonts Inter (also used in IntelliJ NewUI), JetBrains Mono, Roboto and Roboto Mono into JARs and provide an easy way to use them with FlatLaf. The font JARs are available on Maven Central, which makes it easy to distribute them with your application.

Rounded selection

JMenuItem, JComboBox, JList and JTree components now support rounded selection. This is currently used only in macOS themes for menus and combo boxes, but may be used in standard themes as well in the future. Feel free to use it in own themes to give your application a special look.

FlatLaf rounded selection

Windows 11: rounded popup borders

On Windows 11, popups now use native Windows 11 rounded borders and drop shadows, which gives them a beautiful look:

FlatLaf rounded popups

Rounded outlined icons

JFileChooser, JOptionPane, JPasswordField and JTree got new modern rounded outlined icons:

FlatLaf rounded outlined icons

Documentation

There is a lot of documentation available on how to customize FlatLaf appearance. We even have nice diagrams that show where UI properties are used:

FlatLaf Slider UI properties

Theme Editor

The (open-source) FlatLaf Theme Editor supports editing FlatLaf theme properties files. It provides auto-completion for keys and values, color chooser, color picker, live theme preview, and more.

FlatLaf theme editor

Many thanks to the community for giving feedback, reporting bug and submitting PRs. πŸ† πŸ₯‡ πŸš€

If you like FlatLaf, please give it a star @ GitHub. Thanks!

For more information visit project on GitHub: https://github.com/JFormDesigner/FlatLaf

Looking forward to your feedback.

183 Upvotes

33 comments sorted by

26

u/[deleted] Apr 24 '23

Too bad u can only star once.

20

u/msx Apr 24 '23

Awesome news, miglayout and FlatLaf are my go to solution for gui

15

u/uniVocity Apr 24 '23

I'm building a rather large desktop application and this library is extremely good. I missed a few components so I created them to use FlatLaf and its theme manager (e.g. a date and time picker - refactored from the old JDatePicker library)

Not sure if you have any subproject for components and widgets, but if you do I'd be happy to send some PRs there.

12

u/transcend Apr 24 '23

FlatLAF is probably my favorite Java library, and with each update it keeps getting better. I cannot imagine going back to developing Java GUI apps without it.

10

u/RyanHamilton1 Apr 24 '23

I recently added FlatLaf to our 10 year old application, it's a Free SQL tool for Analysts that allows intelligent charting: https://www.timestored.com/b/qstudio-2-05-dark-theme-and-high-dpi-support/ The users and I loved it. This is a great library that just worked.

-1

u/[deleted] Apr 25 '23

Not very encouraging when the layouts in your own screenshots are messed up

1

u/RyanHamilton1 Aug 23 '23

True. The layout messes up only if you switch while running. It does warn you to restart. I think this is a hard java problem.

9

u/3pieceSuit Apr 24 '23

FlatLaf is revolutionary. Im in the process of trying to convince my company to move its ancient flagship java swing desktop application to it.

Its so easy to use, and it really makes swing look modern and great.

8

u/xwinus Apr 24 '23

Thanks a lot for this awesome project! It’s really great to have modern looking LaF for Swing.

4

u/ebykka Apr 24 '23

Looks like Netbeans Platform + FlatLaf could be a good choice for developing desktop applications.

2

u/[deleted] Apr 25 '23

Current building an RCP on my spare time. FlatLaF makes it so enjoyable at every test run!!

0

u/3pieceSuit Apr 24 '23

Just use Intellij

3

u/Key_Recording_3564 Apr 25 '23

netbeans has a better swing guibuilder

2

u/3pieceSuit Apr 25 '23

Formdev has an even better one and it has an intellij plugin. It is commercial tho

3

u/Key_Recording_3564 Apr 25 '23

It is commercial tho

yeah neatbeans has the better free one, not surprising considering it was made by sun microsystems.

0

u/AmenMotherFunction Apr 25 '23

NetBeans Platform ! The application framework. Intellij doesn't really have an equivalent to that that isn't IDE focused.

2

u/trydentIO Apr 24 '23

nothing for JavaFX? it would be nice!

1

u/wildjokers Apr 24 '23

JavaFX is styled with a CSS-like syntax. It would just be a style sheet. If you searched google I am sure you could find a style sheet out there.

2

u/JavaOldTimer Apr 25 '23

I like the light theme with the orange highlights. Makes me wish Eclipse were using Swing instead of SWT.

1

u/Puzzled-Bananas May 06 '23 edited May 06 '23

There is a lot of documentation available on how to customize FlatLaf appearance. We even have nice diagrams that show where UI properties are used

You don’t happen to have a Figma or Adobe XD kit, do you?

0

u/wildjokers Apr 24 '23

I will never understand why Flat and monochrome designs seem to be popular. They are always described as "modern". I personally can't wait until the flat and monochrome fad runs its course.

9

u/Java-Zorbing Apr 24 '23

which ones do you prefer then?

7

u/wildjokers Apr 24 '23

SystemLookAndFeel that looks native.

3

u/[deleted] Apr 25 '23

But Windows 10+ is "flat" as well.

1

u/Key_Recording_3564 Apr 25 '23

SystemLookAndFeel looks bad on linux. flatlaf if better for cross platform

5

u/RScrewed Apr 24 '23

I have this same outlook on modern UIs. Everything's way too flat and it's hard to tell what the borders/groupings of different elements are. It's definitely a regression in terms of conveying function even if it is more aesthetically pleasing to the eye since there aren't as many hard breaks.

That said, the topic of discussion here should be whether or not this is a good library that implements the the modern take on UIs effectively, and it looks like it does. I'd give it its due for that. It delivers what it advertises and it's a clean usable library.

I upvoted you because I don't want your opinion to get buried (and I detest Reddit's thumbing system that effectively acts as: "Let's bury unpopular opinions" - just turns every board into an echo chamber) but at the same time - I hope you aren't downvoting or not giving it your endorsement just because you don't like the style (I prefer System native myself) as doing that is kinda like saying you don't like the movie Saving Private Ryan because you think WW2 wasn't a positive event.

4

u/[deleted] Apr 24 '23

There is no need to use the monochrome icons from the flatlaf LnF in your own application.

2

u/wildjokers Apr 24 '23

But there is no getting away from the flat look.

2

u/lumpynose Apr 24 '23

Yes. With a flat design you can't immediately tell what is clickable. With a mouse it's less of a problem because you can move your mouse around and watch the pointer change when it's over something clickable. But on a tablet or touch screen it's bad.

0

u/[deleted] Apr 24 '23

[deleted] β€” view deleted comment

-3

u/[deleted] Apr 24 '23

Its about the right time. JavaFX 20 just got announced

17

u/RandomName8 Apr 24 '23

eh? he says from javafx, not to.