// 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:   AppletFrame.java

package lt.monarch.swing.applet;

import java.applet.Applet;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JApplet;
import javax.swing.JFrame;

public class AppletFrame extends JFrame
{

	public AppletFrame(final JApplet applet, String s, Dimension dimension)
	{
		setTitle(s);
		setDefaultCloseOperation(0);
		getContentPane().add(applet);
		addWindowListener(new WindowAdapter()
	{

		public void windowOpened(WindowEvent windowevent)
		{
			applet.start();
		}

		public void windowClosing(WindowEvent windowevent)
		{
			applet.stop();
			applet.destroy();
			System.exit(0);
		}

	});
		applet.init();
		setSize(dimension);
		Dimension dimension1 = getToolkit().getScreenSize();
		setLocation(new Point((dimension1.width - dimension.width) / 3, (dimension1.height - dimension.height) / 3));
		show();
	}

	

}
