import java.awt.*;

public class Fenster extends Frame{
	private Image dbImage;
	private Graphics dbGraphics;

	public Fenster(){
		super();
	}
	
	public Fenster(String s){
		super(s);
	}

	public void update(Graphics g){
		//Double-Buffer initialisieren
		if(dbImage == null||this.getSize().height!=dbImage.getHeight(this)||this.getSize().width!=dbImage.getWidth(this)){
			dbImage = createImage(this.getSize().width, this.getSize().height);
			dbGraphics = dbImage.getGraphics();
		}
		//Hintergrund loeschen
		dbGraphics.setColor(getBackground());
		dbGraphics.fillRect(0,0,this.getSize().width, this.getSize().height);
		//Vordergrund zeichene
		dbGraphics.setColor(getForeground());
		paint(dbGraphics);
		//Offscreen anzeigen
		g.drawImage(dbImage,0,0,this);
	}

	




}