title: Customizing the theme for Metal LookAndFeel
body: <p>Currently my application is running on Windows environment and as per new requirement we need port on Linux. </p>
  
  <p>But my application is using the Windows look and feel which is only supported on windows platform and I am getting exception listed below when I run it on Linux. </p>
  
  <p>I am facing the issues like component size mismatch and button colors when I planned to go ahead with GTK Look and feel. </p>
  
  <p>Then I went Metal look and feel with my own theme, but still application is throwing the same exception.</p>
  
  <pre><code>MetalLookAndFeel.setCurrentTheme(MyTheme());
  UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
  
  public class MyTheme extends DefaultMetalTheme {
  
      public String getName() {
          return "MyTheme";
      }
      ColorUIResource primary1 = new ColorUIResource(0, 78, 115);
      ColorUIResource primary2 = new ColorUIResource(102, 193, 122);
      ColorUIResource primary3 = new ColorUIResource(153, 244, 173);
      ColorUIResource secondary1 = new ColorUIResource(196, 172, 134);
      ColorUIResource secondary2 = new ColorUIResource(209, 192, 163);
      ColorUIResource secondary3 = new ColorUIResource(223, 211, 190);
      private final FontUIResource controlFont = new FontUIResource("Dialog", 0, 11);
  
      protected ColorUIResource getPrimary1() {
          return primary1;
      }
  
      protected ColorUIResource getPrimary2() {
          return primary2;
      }
  
      protected ColorUIResource getPrimary3() {
          return primary3;
      }
  
      protected ColorUIResource getSecondary1() {
          return secondary1;
      }
  
      protected ColorUIResource getSecondary2() {
          return secondary2;
      }
  
      protected ColorUIResource getSecondary3() {
          return secondary3;
      }
  
      public FontUIResource getControlTextFont() {
          return controlFont;
      }
  }
  
  
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.995 | Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.995 |     at javax.swing.plaf.basic.BasicButtonUI.getMinimumSize(BasicButtonUI.java:352)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.995 |     at javax.swing.JComponent.getMinimumSize(JComponent.java:1714)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.995 |     at java.awt.BorderLayout.minimumLayoutSize(BorderLayout.java:651)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.995 |     at java.awt.Container.minimumSize(Container.java:1651)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.995 |     at java.awt.Container.getMinimumSize(Container.java:1636)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at javax.swing.JComponent.getMinimumSize(JComponent.java:1716)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.FlowLayout.minimumLayoutSize(FlowLayout.java:448)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.Container.minimumSize(Container.java:1651)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.Container.getMinimumSize(Container.java:1636)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at javax.swing.JComponent.getMinimumSize(JComponent.java:1716)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.GridBagLayout.GetLayoutInfo(GridBagLayout.java:1094)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.GridBagLayout.getLayoutInfo(GridBagLayout.java:893)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.GridBagLayout.ArrangeGrid(GridBagLayout.java:2052)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.GridBagLayout.arrangeGrid(GridBagLayout.java:2008)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.GridBagLayout.layoutContainer(GridBagLayout.java:789)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.Container.layout(Container.java:1421)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.Container.doLayout(Container.java:1410)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.Container.validateTree(Container.java:1507)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.Container.validateTree(Container.java:1513)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.Container.validateTree(Container.java:1513)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.Container.validateTree(Container.java:1513)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.Container.validateTree(Container.java:1513)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.Container.validate(Container.java:1480)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:669)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:124)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:642)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.EventQueue.access$000(EventQueue.java:85)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.EventQueue$1.run(EventQueue.java:603)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.EventQueue$1.run(EventQueue.java:601)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.security.AccessController.doPrivileged(Native Method)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.EventQueue.dispatchEvent(EventQueue.java:612)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
  INFO   | jvm 1    | main    | 2013/01/21 15:14:23.996 |     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
  </code></pre>