import java.awt.Component;
import java.awt.EventQueue;

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JMenu;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JSlider;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JToolBar;
import javax.swing.UIManager;
import javax.swing.plaf.nimbus.NimbusLookAndFeel;

public class NimbusNull {
  static void tstname(final Component c) {
    System.out.printf("%-30s: bkg set %6b -> setting name -> ",
      c.getClass().getSimpleName(), Boolean.valueOf(c.getBackground() != null));
    c.setName("noname");
    System.out.printf(" bkg set %6b%n",
      Boolean.valueOf(c.getBackground() != null));
  }

  public static void main(final String[] args) {
    EventQueue.invokeLater(new Runnable() {
      @Override
      public void run() {
        try {
          UIManager.setLookAndFeel(NimbusLookAndFeel.class.getName());
        } catch (final Exception e) {
          e.printStackTrace();
        }
        tstname(new JTextArea());
        tstname(new JTextField());
        tstname(new JComboBox());
        tstname(new JCheckBox());
        tstname(new JRadioButton());
        tstname(new JButton());
        tstname(new JPanel());
        tstname(new JTable());
        tstname(new JTabbedPane());
        tstname(new JScrollPane());
        tstname(new JSlider());
        tstname(new JMenu());
        tstname(new JToolBar());
      }
    });
  }
} 