
import java.awt.*;
import javax.swing.JPanel;

class Panel extends JPanel
{
   private Image img;

   public void paintComponent(Graphics g)
   {
    super.paintComponent(g);
    if(img != null) g.drawImage(img, 0, 0, null);
   }

   public void setImage(Image imm)
   {
        this.img = imm;
        this.repaint();
   }

   public void setImage(Image i, int w, int h)
   {
        this.img = i;
        this.setPreferredSize(new Dimension(w, h));
        this.repaint();
   }

}
