title: How to add an image to a JFrame container?
body: <p>i have this code where the container displays a specific background color.<br>
  Instead of displaying the color i want to add an image to the background,how should i do it?  </p>
  
  <pre><code>public class mark {
  
  public static void main(String[] args) {
      // TODO Auto-generated method stub
  
      wmmain m=new mark().new wmmain();
      m.setSize(800,500);
      m.setVisible(true); 
  
  }
  class wmmain extends JFrame /* MAIN WINDOW */
  {
      Container container;
  
      public wmmain()
      {
          super("Digital Image WaterMarking");
  
          addWindowListener(new WindowAdapter()
          {
              public void windowClosing(WindowEvent e)
              {
                  System.out.print("Exit");
                  System.exit(0);
              }
          });
  
  
  
          container=this.getContentPane();
          container.setLayout(new BorderLayout());
          container.setBackground(new Color(72, 118, 255));
  
      }
      }
  }
  </code></pre>