Java Swing look and feel - How to use the default look and feel

Java Swing FAQ: How do I set my Java/Swing (GUI) application to use the default look and feel of the current system/platform?

In a Java / Swing application, to use the default look and feel of the current operating system (platform), first import the necessary class:

import javax.swing.UIManager;

Then use this code:

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());