package glycoMain;

import gui.SugarPanel;
import javax.swing.JApplet;
import javax.swing.JFrame;
import javax.swing.JScrollPane;

@SuppressWarnings("serial")
public class SugarApplet extends JApplet{

	
	public SugarApplet()
    {
        System.out.println("Java");
    }


    public void init(){
		JScrollPane all = new JScrollPane();
		all.setViewportView(new SugarPanel());	
    	getContentPane().add(all);
    	System.setSecurityManager(null);
    }
    //start
public void start()
    {
            System.out.println("Applet starting");
    }
    //stop
    public void stop()
    {
            System.out.println("Applet stopping");
    }
    //destroy
    public void destroy()
    {
            System.out.println("Applet destroyed");
    }

    public static void main(String[] args) {
        run(new SugarApplet(), 800, 150);
      }

      public static void run(SugarApplet sugarApplet, int width, int height) {
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(sugarApplet);
        frame.setSize(width, height);
        sugarApplet.init();
        sugarApplet.start();
        frame.setVisible(true);
      
    }
}