title: Background image doesn't show in Swing Netbeans builder
body: <p>I am using the netbeans builder "design" on a JFrame class.
  I have the traditional JFrame, I added into it (with the builder) a JPanel.</p>
  
  <p>Now in the code, I want to add a background to this panel like this :</p>
  
  <pre><code>public class NewJFrame extends javax.swing.JFrame {
  
      public NewJFrame() {
          initComponents();
          addBackground();
      }
  
      private void addBackground()
      {
          Image bgImage;
          try {
              bgImage = ImageIO.read(new File("src/general/Mockup.png"));
              jPanel1.add(new NewJFrame.ImagePanel(bgImage));
              jPanel1.repaint();
          } catch (IOException ex) {
              Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
          }
      }
  
      public static void main(String args[]) {
  
          /* Create and display the form */
          java.awt.EventQueue.invokeLater(new Runnable() {
              public void run() {
                  new NewJFrame().setVisible(true);
              }
          });
      }
  }
  </code></pre>
  
  <p>I don't see anything, just an empty JFrame/JPanel.</p>
  
  <p>Btw, I am using this for the ImagePanel code</p>
  
  <pre><code>@SuppressWarnings("serial")
  class ImagePanel extends JPanel {
      private Image image;
  
      ImagePanel(Image image) {
          this.image = image;
      };
  
      @Override
      public void paintComponent(Graphics g) {
          super.paintComponent(g);
          g.drawImage(image, 0, 0, getWidth(), getHeight(), this);
      }
  }
  </code></pre>