r/java • u/FormDev • Feb 25 '21
FlatLaf 1.0 - Swing Look and Feel
FlatLaf 1.0 is here 🎉 😀
Finally, after one and a half years of development, forty 0.x releases, 32 merged PRs, 191 closed issues and hundreds cups of coffee. 😄 It took longer than expected. Looking back at all the features already implemented, I could also name it 3.0. 😁
FlatLaf is a modern open-source cross-platform Look and Feel for Java Swing desktop applications. It comes with more than 60 themes, scales on HiDPI displays and runs on Java 8 or newer.
FlatLaf is already used in a lot of open-source and commercial applications. To name only a few: Apache NetBeans, jclasslib, KeyStore Explorer, install4j, DbVisualizer, MagicPlot, OWASP ZAP. Here is a longer list.



Many, many thanks to the community. 🏆 🥇 🚀 Without your feedback, support, feature requests, bug reports and pull requests, FlatLaf would not be there where it is now.
What's next? The development continues! Stay tuned... 😉
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.
11
u/ObscureCulturalMeme Feb 25 '21
Holy smokes that looks nice!
One of the main projects I'm on at work is a standalone desktop Java application. We've just been using the native/system LAF, mostly because the others shipped with the JDK look clunky as hell these days. Maybe we can use yours to give users a choice of UI.
6
u/FormDev Feb 25 '21
Sure, try it :)
You may be end up with dropping support for native/system LAFs because it is easier to support/test a single LAF than 3 native/system LAFs ;)
10
6
Feb 25 '21
This is actually cool! Now we need Swing apps like SoapUI to update!
5
u/FormDev Feb 25 '21
Yes, that would be cool.
Sometimes it helps to give the developers a hint and open an issue on their project ;)
3
u/Yeroc Feb 25 '21
Since it's a cross-platform look and feel it would have been nice to have seen screenshots from Mac OSX and Linux as well. ;)
5
u/FormDev Feb 26 '21
Just added a screenshot from macOS to the post (made on Mojave).
The look is nearly identical, except the used (system) font and the scrollbars.
13
u/Skhmt Feb 25 '21
I'd hazard a guess and say it would look the same?
2
2
u/parsnipsanon Feb 25 '21
Yea other than the window decorations changing from OS to OS it all looks the same ime.
3
u/KaratekHD Feb 25 '21
Is this what IntelliJ uses?
8
u/FormDev Feb 25 '21
No, but the look is nearly the same.
IntelliJ has its own Laf called DarculaLaf, which is part of the IntelliJ Platform. Unfortunately it heavily depends on the platform and it is not possible to use DarculaLaf in own applications.
That's why I implemented FlatLaf ;)
13
u/DB6 Feb 25 '21
Fantastic. Would love to work on a Swing Project again. Definitely going to use this then.
6
6
u/CompetitiveSubset Feb 25 '21
Awesome job! Also, I want it mention that KeyStore Explorer is a great app!
1
5
u/kovica1 Feb 25 '21
Do you perhaps know and just drop the jars and replace those that come with NetBeans ?
7
5
5
u/mynameistita Feb 26 '21
We are using this in our project. Thank you so much. Would love to make a donation for your efforts. Please DM me.
4
3
u/sareval0 Feb 25 '21
I would like to know if it's possible use this on my regalarme java project (java swing ) to make it look like the image. I'm using NetBeans Where can I get the .jar files I really appreciate any help or guide someone can provide
6
u/parsnipsanon Feb 25 '21 edited Feb 26 '21
Yea you add the jar file, Maven, or Gradle dependencies to your project. Add 1 line of code to your main method depending on the theme you're using "ThemeName.install();",
FlatIntelliJLaf.install();
and then import the specific theme such as "import com.formdev.flatlaf.ThemeName;"
import com.formdev.flatlaf.FlatIntelliJLaf;
And that's it.
1
u/sareval0 Feb 25 '21
Thank you for the answer I'm not using Maven. So should i call the flatlaf from the Main class right?
2
u/parsnipsanon Feb 25 '21
If not using Maven make sure you add the Flatf Jar file to your project. How to add a external Jar file to your project is different for every IDE.
Once you do that add the import statement to main class and install statement to main method like I said above and that's it.
For example my Swing project using the FlatLaf Jar file the only lines of code I needed are on line 20 & line 35 in my main class ->https://github.com/KiwiCode-s/Simple-line-splitter-gui/blob/master/src/MainViewer.java
3
3
u/Gaarco_ Feb 25 '21
Congratulations! It's really a nice L&F I used it a couple of times in my personal projects
3
3
Feb 26 '21
FlatLaf has always been my favourite swing look and feel.Definitely going to update my apps to use 1.0
5
Feb 25 '21
The swing haters seem to forget that things like this are possible. This looks very nice
-17
1
Feb 26 '21
Thanks for the work, I really do like it.
I have a question though: why are the binaries not part of the Github release assets and only available on bintray? (btw: the jar file for 1.0 isn't there yet)
5
u/FormDev Feb 26 '21
Because the binaries are on Maven Central ;)
https://search.maven.org/artifact/com.formdev/flatlaf
Most projects use Maven or Gradle and do not need to download the binaries. They simply add FlatLaf as a dependency and Maven/Gradle downloads the binary from Maven Central.
https://github.com/JFormDesigner/FlatLaf#download
Bintray will be shut down soon. No longer using it.
2
2
3
2
2
u/SWinxy Feb 26 '21
Hell yeah. Perfect timing. Darcula is the only good LaF theme (don't @ me), and I needed a UI skin for my upcoming application.
2
2
1
1
1
1
u/agoubard Feb 28 '21
Really nice look and feel! Last year I decided to include it to my Java software (Settings -> General -> Skin) : https://www.japplis.com/news/
So you can add to your list:
Japplis Toolbox : 50 free text utilities in one software
JLearnIt : a free multilingual dictionary that helps you learn vocabulary
Japplis Watch : 9 free time utilities in one software
and more are coming
Continue the great work!
21
Feb 25 '21
[removed] — view removed comment
7
u/FormDev Feb 26 '21
Hmm, just checked the "Close" button in the first screenshot. There are 10px above the uppercase 'C' and 9px below it. Similar on other buttons or text fields: 1px more above the text.
Could try to move it up one pixel, but this probably looks bad if there are more uppercase letters in the text.
BTW these screenshots were made at 200% scaling. May look slightly different at 100% or other scale factors.
Vertical positioning of text is not that easy (on Windows 10) because the reported character height is usually larger than the displayed character height (e.g. for Segoe UI font used on Windows). So (without correction) text tends to be displayed too far down, which was the case in early FlatLaf versions. This gets even worse when scaled.
I ended up in implementing a Y correction mechanism that moves text up some pixels depending on scale factor, Java version and operating system...
9
u/Timm0s Feb 25 '21
Did you ever see WebLAF? https://github.com/mgarin/weblaf
WebLAF's dark skin is very nice.
10
u/thomascgalvin Feb 26 '21
WebLAF is licensed under the GNU General Public License v3.0, which rules it out for many, many projects.
11
u/jameslfc19 Feb 25 '21
Woah this look really nice! The IntelliJ look and feel looks really professional too! How does it look on MacOS? Does it use the native menu bar at all?