title: Set the Background Color for JTabbedPane
body: <p>I am using Nimbus Look and feel. I needs to change the Background color and foreground color of the tab in JTabbedPane but the color doesn't set in JTabbedPane. I tried setForeground(), setForegroundAt(), setBackground() and setBackgroundAt() methods but it isnt works.This is my code</p>
  
  <p><pre><code>
  public class TabbedPaneDemo extends JFrame
  {
      TabbedPaneDemo()
      {
          try
          {
              UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
          }
          catch(Exception ex) {}</p>
  
  <code>    setLayout(new BorderLayout());
      setBounds(100, 100, 800, 500);
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
      JTabbedPane jt = new JTabbedPane();
      jt.addTab("Tab1", new JPanel());
      jt.addTab("Tab2", new JPanel());
      jt.addTab("Tab3", new JPanel());
      jt.addTab("Tab4", new JPanel());
  
      for( int i = 0; i &lt; jt.getComponentCount(); i++)
      {
          jt.setForegroundAt(i, Color.RED);
          jt.setBackgroundAt(i, Color.BLACK);
      }
  
      add(jt);
  
      setVisible(true);
  }
  
  public static void main(String args[])
  {
      new TabbedPaneDemo();
  }
  </code></pre>
  
  <p>}</code></p>