Spicing up your Java SwingUI using custom Look and Feel

Amos Chepchieng
3 min readAug 13, 2020

User Interface design can be difficult especially when you want to give your software a modern look and feel, my name is KeepToo and I have been creating custom user interfaces and components using Java Swing and JavaFX for a while and I must say it’s freaking tedious but the end product usually is amazing and satisfying. Creating a custom UI needs you to be very keen on details to achieve certain unique design but often this is limited to small or utility software. So what happens if you have huge software like a financial system or say a management system for an institution, well you might not want to go my way rather start looking for Look and Feels online for your project. Why I say that is, the default “Nimbus, Windows, Metal” LAF are pretty boring and will make your software look ancient and also creating your own custom user interface can take you quite some time. So what will you do to solve this problem?

Well I have 2 suggestions you might want to try, 1 free and 1 commercial.

FlatLaf

FlatLaf is a modern open-source cross-platform Look and Feel for Java Swing desktop applications. The LAF is heavily inspired by Darcula and IntelliJ themes from IntelliJ IDEA and uses almost the same colors and icons. The Look and Feel is frequently maintained, has a lot of potential and very many choices of themes to choose from, here you are spoiled for choice. It also has that modern feel vibe.

Example

Light

Dark

Advantages

  • It’s Free
  • Small and light weight — less than 400kb
  • Easy to use
  • Very many themes to choose from with modern look
  • And Frequent updates

Disadvantages

  • Title bar is not decorated on Windows 7 or Mac(I trust the devs to crack this one)

Synthetica

Synthetica Look and Feel is owned by Jyloo Software who basically make Java Swing LAFs and other add ons. Well their pricing is not defined on their page but they give you and email to contact them when you want to purchase. Their LAF is pretty solid and stable.

Example

Light

Dark

Advantages

  • Easy to use
  • Several Solid LAFs to choose from

Disadvantages

  • Large and separate jar files
  • Not easy to customize
  • Limited themes

How to get started

  • Download/Buy the jar files

FlatLaf — https://github.com/JFormDesigner/FlatLaf

Synthetica — jyloo.com/synthetica

  • Add the libraries to your project
  • Head to your main class and add the code as follows

FlatLaf

try {
UIManager.setLookAndFeel(“com.formdev.flatlaf.FlatDarkLaf”);
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
Logger.getLogger(JavaApplication1.class.getName()).log(Level.SEVERE, null, ex);
}
JFrame.setDefaultLookAndFeelDecorated(true);

Synthetica

try {
UIManager.setLookAndFeel(“de.javasoft.synthetica.dark.SyntheticaDarkLookAndFeel”);
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
Logger.getLogger(JavaApplication1.class.getName()).log(Level.SEVERE, null, ex);
}
JFrame.setDefaultLookAndFeelDecorated(true);

Well you are good to go. If you wish to customize these look and feels check their documentations and if you want assistance I can help out in some way.

Hope this article helps you out. For more UI samples on Java Swing and JavaFX feel free to check out my channel.

//Email keeptoo.ui.ux@gmail.com for business inquiries.//

Cheers!!

--

--

Amos Chepchieng

I'm a computer user who writes​ code, UI-UX & Information Security Enthusiast.