// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) space 
// 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 _cls1(applet));
        applet.init();
        setSize(dimension);
        Dimension dimension1 = getToolkit().getScreenSize();
        setLocation(new Point((dimension1.width - dimension.width) / 3, (dimension1.height - dimension.height) / 3));
        show();
    }

    private class _cls1 extends WindowAdapter
    {

        private Applet applet;

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

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

        public void constructor$0(AppletFrame appletframe)
        {
        }

        public _cls1(Applet appl)
        {
        	applet=appl;
            constructor$0(AppletFrame.this);
        }
    }

}
