Java look and feel - how to use the native system look and feel

Question: How do I set my Java/Swing application to use the native look and feel of the platform it is running on?

Answer: Use the Java UIManager class to set the look and feel properly, like this:

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

Note that the setLookAndFeel method can throw an UnsupportedLookAndFeelException exception that you should handle.