//import java.awt. *;
//import java.awt.event. *;
import java.io. *;
//import java.net. *;

import javax.swing. *;
//import javax.swing.event. *;
//import javax.swing.tree. *;


public class LTOOLSapplet extends JApplet
{   //static LTOOLSgui myProg;

    static LTOOLSapplet myapplet;
    static String ltoolappletCodeBase;

    public LTOOLSapplet()
    {
    	System.out.println("New LTOOLSapplet");
    }

    public void init()
    {
    	System.out.println("Init() LTOOLSapplet");
//    	super.init();

	String args[] = new String[2];
	args[0] = getParameter("LINUXDRIVE");
	args[1] = getParameter("DOSDRIVE");

        ltoolappletCodeBase=(""+getCodeBase()).substring(6);
        ltoolappletCodeBase=ltoolappletCodeBase.replace('/',File.separatorChar);
	LTOOLSgui.isApplet=true;
	LTOOLSgui.main(args);
	setContentPane(LTOOLSgui.myProg.getContentPane());
	setJMenuBar(LTOOLSgui.myProg.mainJMenuBar);
	LTOOLSgui.myProg.setVisible(false);
    }


    public void start()
    {
    	System.out.println("Start() LTOOLSapplet");
//	super.start();
    }

    public void stop()
    {	System.out.println("Stop() LTOOLSapplet");
    	// if (LTOOLSgui.myProg.Connected)
        if (LTOOLSgui.myProg.isConnected())
    	    LTOOLSgui.myProg.connectionClose();
//     	super.stop();
    }

    public void destroy()
    {	System.out.println("Destroy() LTOOLSapplet");
    	if (LTOOLSgui.myProg.isConnected())
    	    LTOOLSgui.myProg.connectionClose();
//    	LTOOLSgui.myProg.setVisible(false);
//    	LTOOLSgui.myProg.dispose();
//    	super.destroy();
	System.out.println("End Destroy() LTOOLSapplet");
    }

}
