Java Swing Look and Feel setNiceSwingLookAndFeel()

Here you can find the source of setNiceSwingLookAndFeel()

Description

set Nice Swing Look And Feel

License

Open Source License

Declaration

public static void setNiceSwingLookAndFeel() 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import javax.swing.UnsupportedLookAndFeelException;

public class Main {
    public static void setNiceSwingLookAndFeel() {
        try {//from w w w . j a v  a 2s .c o m
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if (javax.swing.UIManager.getSystemLookAndFeelClassName().equals(info.getClassName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                }

                if ("com.sun.java.swing.plaf.gtk.GTKLookAndFeel".equals(info.getClassName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
                | UnsupportedLookAndFeelException e) {
            e.printStackTrace();
        }
    }
}

Related

  1. setMotifLookAndFeel()
  2. setMotifLookAndFeel()
  3. setMotifLookAndFeel()
  4. setNativeLookAndFeel()
  5. setNativeLookAndFeel()
  6. setNimbusLookAndFeel()
  7. setNimbusLookAndFeel()
  8. setSOMToolboxLookAndFeel()
  9. setSystemLAF()