view src/samer/applet/ButtonsApplet.java @ 8:5e3cbbf173aa tip

Reorganise some more
author samer
date Fri, 05 Apr 2019 22:41:58 +0100
parents bf79fb79ee13
children
line wrap: on
line source
/*
 *	ButtonsApplet.java	
 *
 *	Copyright (c) 2000, Samer Abdallah, King's College London.
 *	All rights reserved.
 *
 *	This software is provided AS iS and WITHOUT ANY WARRANTY; 
 *	without even the implied warranty of MERCHANTABILITY or 
 *	FITNESS FOR A PARTICULAR PURPOSE.
 */

package samer.applet;
import  java.awt.*;


public class ButtonsApplet extends JApplet
{
	public void init()
	{
		super.init();

		JAppletShell.instance.registerButtons(this);

		// set layout here
		String dir=getParameter("layout");
		if ("vertical".equals(dir)) 
			setLayout(new GridLayout(0,1,8,8));
		else {
			String grid=getParameter("grid");

			if ("true".equals(grid)) setLayout(new GridLayout(1,0,8,8));
			else      setLayout(new FlowLayout(FlowLayout.LEFT,4,4));
		}
	}

	public void destroy()
	{
		JAppletShell.instance.deregisterButtons(this);
		super.destroy();
	}
}