Thanks to visit codestin.com Credit goes to sourceforge.net
Download this file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
import java.awt.*; import javax.swing.*; public class ImagePanel extends JPanel { ImageProvider ip; public ImagePanel(ImageProvider _ip) { ip = _ip; setPreferredSize( new Dimension( ip.getImage().getWidth(), ip.getImage().getHeight())); } public void paint(Graphics g) { g.drawImage(ip.getImage(), 0, 0, null); } }