使用现成的swingx提供的JXPanel
JXPanel panel = new JXPanel();BufferedImage bi = ...;panel.setBackgroundPainter(new ImagePainter(bi));