Java Swing Look and Feel isNimbus()

Here you can find the source of isNimbus()

Description

Determines if current L&F is Nimbus or GTK with Nimbus theme

License

Open Source License

Declaration

public static boolean isNimbus() 

Method Source Code

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

import java.awt.Toolkit;

import javax.swing.UIManager;

public class Main {
    /**/*  w  w w.  j a  va  2  s.  c  om*/
     * Determines if current L&F is Nimbus or GTK with Nimbus theme
     */
    public static boolean isNimbus() {
        // is current L&F Nimbus or GTK with Nimbus theme?
        return isNimbusLookAndFeel() || isNimbusGTKTheme();
    }

    /**
     * Determines if current L&F is Nimbus
     */
    public static boolean isNimbusLookAndFeel() {
        // is current L&F Nimbus?
        return UIManager.getLookAndFeel().getID().equals("Nimbus"); //NOI18N
    }

    /**
     * Determines if current L&F is GTK using Nimbus theme
     */
    public static boolean isNimbusGTKTheme() {
        // is current L&F GTK using Nimbus theme?
        return isGTKLookAndFeel()
                && "nimbus".equals(Toolkit.getDefaultToolkit().getDesktopProperty("gnome.Net/ThemeName")); //NOI18N
    }

    /**
     * Determines if current L&F is GTKLookAndFeel
     */
    public static boolean isGTKLookAndFeel() {
        // is current L&F some kind of GTKLookAndFeel?
        return UIManager.getLookAndFeel().getID().equals("GTK"); //NOI18N
    }
}

Related

  1. isMotif()
  2. isMotiflLnF()
  3. isNativeMacLookAndFeel()
  4. isNimbus()
  5. isNimbus()
  6. isNimbusGTKTheme()
  7. isNimbusLookAndFeel()
  8. isNimbusLookAndFeel()
  9. isPlasticLaf()