// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) fieldsfirst 
// Source File Name:   DoubleBufferPanel.java

package lt.monarch.awt;

import java.awt.*;

public class DoubleBufferPanel extends Panel
{

	private Image cache;

	public DoubleBufferPanel()
	{
	}

	public void invalidate()
	{
		super.invalidate();
		cache = null;
	}

	public void paint(Graphics g)
	{
		if(cache == null)
			cache = createImage(size().width, size().height);
		Graphics g1 = cache.getGraphics();
		g1.clipRect(0, 0, size().width, size().height);
		super.paint(g1);
		g1.dispose();
		g.drawImage(cache, 0, 0, null);
	}

	public void update(Graphics g)
	{
		paint(g);
	}
}
