To set the look and feel for your swing application, you can use the following code:

public static void main(String[] args) {
	try {
	catch (Exception ie) { 
		System.out.println("UI not supported.");
	new MyClass();

which will apply the platform standard look and feel.

However, this look and feel may not be supported so when coding your interface, be sure to make it look decent with the default swing interface. Possible values to pass the UIManager.setLookAndFeel() method are:

  • “javax.swing.plaf.metal.MetalLookAndFeel” - standard Java Look & Feel
  • “” - windows (only works on Win32 systems)
  • “” - CDE/Motif Look & Feel
  • “javax.swing.plaf.mac.MacLookAndFeel” - Mac (only works on Macintosh)

To get a list of all the look and feel classes installed on your system, use the following:

UIManager.LookAndFeelInfo[] laf = UIManager.getInstalledLookAndFeels();
for (int i=0; i < laf.length; i++) {

To update the UI after your application has loaded, use the following code:

try {
catch (Exception exc) {
	System.out.println("Unable to change look and feel: " + exc.getMessage());

Removing bold font with Metal Look and Feel

The metal look and feel has a font that defaults to bold - if you want to turn this off, add the following line before you call UIManager.setLookandFeel(..):

UIManager.put("swing.boldMetal", Boolean.FALSE);