posted 20 years ago
Background suggests that you may be doing things in the foreground like adding components. If so you could render the image in the 'paintComponent' method of the JPanel. If there are no components added to the panel you'll need to provide size information for it by calling 'setPreferredSize' or overriding 'getPreferredSize'. Use the image dimensions for the size if you want the panel to be the size of the image.
If you only want to show an image as–is, JLabel makes this easy with ImageIcon to hold the image. The swing tutorial has a page on using icons.