title: On using Nimbus look and feel, JButton vanishes totally in a JFrame if there is a background image
body: <p>I have a JFrame. In that i have used:</p>
  
  <ol>
  <li>JTabbed panes.</li>
  <li>JButton.</li>
  <li>background images in a Jlabel which is added in JPanel.</li>
  <li>Nimbus look and feel.</li>
  </ol>
  
  <p>My problem is that whenever i use Nimbus look and feel the JButton vanishes only if there is a background image added. But this doesn't happen with other look and feel. Can anyone help me in getting the button visible?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import javax.swing.ImageIcon;
  import javax.swing.JTabbedPane;
  import javax.swing.JTextField;
  import javax.swing.JLabel;
  import javax.swing.JPanel;
  import javax.swing.JButton;
  import javax.swing.JFrame; 
  import javax.swing.SwingUtilities;
   import javax.swing.UIManager;
  import javax.swing.UnsupportedLookAndFeelException;
  import javax.swing.UIManager.LookAndFeelInfo;
  
  import java.awt.*;
  import java.awt.event.*;
  
  class ImageTest 
  {
  JTabbedPane tp;
  JLabel lab1;
  JPanel  welcome;
  JFrame frame;
  ImageIcon image2;
  JButton b1;
  public void createUI()
  {
      frame=new JFrame("JTabbedPane Example");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
  
      b1=new JButton();
      welcome= new JPanel(null);
      welcome.setPreferredSize(new Dimension(1366,786));
      ImageIcon icon = new ImageIcon(ImageTest.class.getResource("icloud.jpg"));
  
      tp=new JTabbedPane();
              Container pane = frame.getContentPane();
      pane.add(tp);
      tp.addTab("Welcome", welcome);
              lab1=new JLabel();
      lab1.setIcon(icon);
  
      b1.setBounds(100,100,100,100);
      lab1.setBounds(0,0,1500,700);
              welcome.add(lab1);
              welcome.add(b1);
              b1.setVisible(true);
      frame.setSize(500,500);
      frame.setVisible(true);
      frame.setTitle("I-Cloud");
  
  }   
  public static void main(String[] args) 
  {
  
        try {
          for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
              if ("Nimbus".equals(info.getName())) {
                  UIManager.setLookAndFeel(info.getClassName());
                  break;
              }
          }
      } catch (Exception e) {
  
      }   
        ImageTest w = new ImageTest();
        w.createUI();   
  
       }
      }
  </code></pre>
  
  <p>EDIT:</p>
  
  <pre><code> import javax.swing.ImageIcon;
   import javax.swing.JTabbedPane;
   import javax.swing.JTextField;
   import javax.swing.JLabel;
   import javax.swing.JPanel;
   import javax.swing.JButton;
   import javax.swing.JFrame;
   import javax.swing.SwingUtilities;
   import javax.swing.UIManager;
   import javax.swing.UnsupportedLookAndFeelException;
   import javax.swing.UIManager.LookAndFeelInfo;
  
   import java.awt.*;
   import java.awt.event.*;
  
   class ImageTest 
    {
   JTabbedPane tp;
   JLabel lab1;
   JPanel  welcome,w;
   JFrame frame;
   ImageIcon image2;
   JButton b1;
  
  public void createUI()
  {
      frame=new JFrame("JTabbedPane Example");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
      b1=new JButton();
      welcome= new JPanel(new GridLayout(1,1,15,15));
      w=new JPanel (new GridLayout(1, 1, 15, 15));
      welcome.setPreferredSize(new Dimension(1366,786));
  
      ImageIcon icon = new ImageIcon(ImageTest.class.getResource("icloud.jpg"));
  
      tp=new JTabbedPane();
              Container pane = frame.getContentPane();
      pane.add(tp);
  
  
      lab1=new JLabel();
      lab1.setIcon(icon);
      w.setOpaque(false);
      w.add(b1);
  
  
      b1.setVisible(true);
              welcome.add(lab1);
              welcome.add(w);
              tp.addTab("Welcome", welcome);
  
      frame.setSize(500,500);
      frame.pack();
      frame.setVisible(true);
      frame.setTitle("I-Cloud");
  
  }   
  public static void main(String[] args) 
  {
      try {
          for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
              if ("Nimbus".equals(info.getName())) {
                  UIManager.setLookAndFeel(info.getClassName());
                  break;
              }
          }
      } catch (Exception e) {
  
      }
  
          ImageTest w = new ImageTest();
          w.createUI();   
  
      }
    }
  </code></pre>
  
  <p>Thanks.</p>