import java.applet.*;
import java.awt.*;

public class CompanyClientApplet extends Applet {
	private NetworkCompanyProxy companyProxy;
	private CompanyPresentation presentation;

	public void init() {
		String host = getParameter("Host");
		int port = Integer.parseInt(getParameter("Port"));
		
		companyProxy = new NetworkCompanyProxy(host, port);
		presentation  = new CompanyPresentation(companyProxy);
		
		setLayout(new FlowLayout());
		add(presentation);
		
		if (!companyProxy.connect()) 
			System.out.println("Unable to connect to server");
	}
	
	public void destroy() { 
		if (!companyProxy.disconnect()) 
			System.out.println("Unable to disconnect from server");
	}
}
