Giving your Java application a Windows look and feel

By default, Swing components are given what is called the Metal Look and Feel. This gives your application a look which is quite different from many non-Java applications.

To make your Java application look like it is a "native" Windows or Mac OS (etc) application, add the following line of code at startup:

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

Now, your application will look like other applications on the platform they are running on.


If you enjoy this Java programming article, please share with friends and colleagues. Follow the author on Twitter for the latest news and rants.

Editorial page content written by Neil Coffey. Copyright © Javamex UK 2021. All rights reserved.