How to use look and feel in Java?

Just add the code "UIManager.setLookAndFeel (lookAndFeel);" to the

program. If you download
, you can search it on the Internet.
JDK comes with the following:
1, Metal style (default)
String lookAndFeel = "javax.swing.plaf.metal.MetalLookAndFeel";
UIManager.setLookAndFeel (lookAndFeel);
2, Windows style
String lookAndFeel = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
UIManager.setLookAndFeel (lookAndFeel);
3, WindowsClassic style
String lookAndFeel = "com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel";
UIManager.setLookAndFeel (lookAndFeel);

where is the code posted? I posted it in the main function and added a try catch statement, but it didn"t work.

Is

look and feel similar to changing themes?

Mar.07,2021
Menu