import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.util.*;

class PongPane extends JPanel
{
	int width, height;
	PongGame game;
	Image bg=Toolkit.getDefaultToolkit().getImage("valjak.jpg");
	
	public PongPane(int w, int h, PongGame g)
	{
		super();
		width = w;
		height = h;
		game = g;
		super.setSize(width, height);
	}
	
	public void setSize(int w, int h)
	{
		super.setSize(w, h);
		width = w;
		height = h;
	}
	
	public void paintComponent(Graphics aPen)
	{
		//aPen.setColor(new Color(0,0,0));
		//aPen.fillRect(0,0,width,height);
	    aPen.drawImage(bg,0,0,this);
		game.paint(aPen);
	}
}