Java Look and Feel (L&F)
Solution 1
There is a lot of possibilities for LaFs :
- The native for your system
- The nimbus LaF
- Web LaF
- The substance project (forked into the Insubstantial project)
- Napkin LaF
- Synthetica
- Quaqua (looks like aqua from MacOS X)
- Seaglass
- JGoodies
- Liquidlnf
- The Alloy Look and Feel
- PgsLookAndFeel
- JTatoo
- Jide look and feel
- etc.
Resources :
- Best Java Swing Look and Feel Themes | Top 10 (A lot of the preview images on this page are now missing)
- oracle.com - Modifying the Look and Feel
- wikipedia.org - Pluggable look and feel
- Java2s.com - Look and feel
Related topics :
Solution 2
You can try L&F which i am developing - WebLaF
It combines three parts required for successful UI development:
- Cross-platform re-stylable L&F for Swing applications
- Large set of extended Swing components
- Various utilities and managers
Binaries: https://github.com/mgarin/weblaf/releases
Source: https://github.com/mgarin/weblaf
Licenses: GPLv3 and Commercial
A few examples showing how some of WebLaF components look like:
Main reason why i have started with a totally new L&F is that most of existing L&F lack flexibility - you cannot re-style them in most cases (you can only change a few colors and turn on/off some UI elements in best case) and/or there are only inconvenient ways to do that. Its even worse when it comes to custom/3rd party components styling - they doesn't look similar to other components styled by some specific L&F or even totally different - that makes your application look unprofessional and unpleasant.
My goal is to provide a fully customizable L&F with a pack of additional widely-known and useful components (for example: date chooser, tree table, dockable and document panes and lots of other) and additional helpful managers and utilities, which will reduce the amount of code required to quickly integrate WebLaF into your application and help creating awesome UIs using Swing.
Solution 3
You can also use JTattoo (http://www.jtattoo.net/), it has a couple of cool themes that can be used.
Just download the jar and import it into your classpath, or add it as a maven dependency:
<dependency>
<groupId>com.jtattoo</groupId>
<artifactId>JTattoo</artifactId>
<version>1.6.11</version>
</dependency>
Here is a list of some of the cool themes they have available:
- com.jtattoo.plaf.acryl.AcrylLookAndFeel
- com.jtattoo.plaf.aero.AeroLookAndFeel
- com.jtattoo.plaf.aluminium.AluminiumLookAndFeel
- com.jtattoo.plaf.bernstein.BernsteinLookAndFeel
- com.jtattoo.plaf.fast.FastLookAndFeel
- com.jtattoo.plaf.graphite.GraphiteLookAndFeel
- com.jtattoo.plaf.hifi.HiFiLookAndFeel
- com.jtattoo.plaf.luna.LunaLookAndFeel
- com.jtattoo.plaf.mcwin.McWinLookAndFeel
- com.jtattoo.plaf.mint.MintLookAndFeel
- com.jtattoo.plaf.noire.NoireLookAndFeel
- com.jtattoo.plaf.smart.SmartLookAndFeel
- com.jtattoo.plaf.texture.TextureLookAndFeel
- com.jtattoo.plaf.custom.flx.FLXLookAndFeel
Regards
Solution 4
Heres the code that creates a Dialog which allows the user of your application to change the Look And Feel based on the user's systems. Alternatively, if you can store the wanted Look And Feel's on your application, then they could be "portable", which is the desired result.
public void changeLookAndFeel() {
List<String> lookAndFeelsDisplay = new ArrayList<>();
List<String> lookAndFeelsRealNames = new ArrayList<>();
for (LookAndFeelInfo each : UIManager.getInstalledLookAndFeels()) {
lookAndFeelsDisplay.add(each.getName());
lookAndFeelsRealNames.add(each.getClassName());
}
String changeLook = (String) JOptionPane.showInputDialog(this, "Choose Look and Feel Here:", "Select Look and Feel", JOptionPane.QUESTION_MESSAGE, null, lookAndFeelsDisplay.toArray(), null);
if (changeLook != null) {
for (int i = 0; i < lookAndFeelsDisplay.size(); i++) {
if (changeLook.equals(lookAndFeelsDisplay.get(i))) {
try {
UIManager.setLookAndFeel(lookAndFeelsRealNames.get(i));
break;
}
catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
err.println(ex);
ex.printStackTrace(System.err);
}
}
}
}
}
Related videos on Youtube
rajesh
Updated on January 22, 2020Comments
-
rajesh over 4 years
I am developing a desktop application with Java Swing for my personal use.I am in need of some beautiful Look and Feel for my application. How can I do it using Java or a 3rd party API?
-
ecle over 12 yearsLGPL'ed look-n-feel Nimrod by Nilo J. González: personales.ya.com/nimrod/faq-en.html. A little bit buggy (unable to set background color for a JButton - solved with paintComponent() override using a translucent BufferedImage technique)
-
-
nos over 13 yearsQuick way to see how your application looks under Nimbus, start the app with the argument ` -Dswing.defaultlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel` e.g.
java -Dswing.defaultlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel -jar MyApp.jar
-
maciej almost 12 yearsTo use Metal look and feel in existing apps add
-Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel
parameter to java invocation. -
Display Name about 10 yearsWhich of them are okay on "Retina" displays? (not only on OS X, there are laptops on Win 8 with high DPI screens now, too)
-
Tinus Tate over 6 yearsNote that before jumping in without looking at the license that the license is gpl. This might or might not be a problem for some.
-
Jeff Holt over 6 yearsI think spending a few hundred euro for a commercial license is far better than giving that money to your lawyer for his advice, which is likely going to be "buy a commercial license if you use the product". Besides, their site says you get prioritized technical support when you buy a commercial license.