title: How to set Nimbus look and feel in main
body: <p>I am just learning Java and still have not been able to sort out this little problem I have.</p>
  <p>My pop up Calendar uses Nimbus look and feel, but I have panels and container Jtables that use Java's look and feel - I am trying to make every GUI screen/ window use the Nimbus look and feel. It was suggested by Merky to put the following code in my main to make every subsequent screen have the Nimbus look and feel, but I cannot get it to work, so where and how should I put this code?</p>
  <pre class="lang-java prettyprint-override"><code>public static void main(String args[]) {
      SA md = new OptraderSA(&quot;Copyright© 2010 Simon Andi&quot;);
  
      Dimension sd = Toolkit.getDefaultToolkit().getScreenSize();
  
      md.setLocation(sd.width/2-400/2, sd.height/2-400/2);
      md.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
      /*Suggested Code*/
      try {
          for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
              if (&quot;Nimbus&quot;.equals(info.getName())) {
                  UIManager.setLookAndFeel(info.getClassName());
                  System.out.println(&quot;CHOSEN THIS&quot;);
                  break;
              } else {
                  UIManager.setLookAndFeel  (&quot;com.sun.java.swing.plaf.windows.WindowsLookAndFeel&quot;);
              }
          }
      } catch (Exception e) {
          // If Nimbus is not available, you can set to another look and feel.
          // I can't get it to compile or work.
      }
  
  }
  </code></pre>