/*
	Trivial applet that displays a string - 4/96 PNL
*/

import java.awt.*;
import java.applet.Applet;
import java.lang.*;

public class Palette extends Panel
{

	public Palette()
	{
		// Radio buttons presented in a series of centered rows, controled by flowlayout layout manger
		
//		setLayout(new FlowLayout(FlowLayout.CENTER,0,0));
		setLayout(new FlowLayout());
		//Add rado btton for each static color object instantces which are members of color class
		CheckboxGroup group = new CheckboxGroup();
		Checkbox white = new Checkbox("",group, true);
		Checkbox lightGray = new Checkbox("",group, true);
		Checkbox gray = new Checkbox("",group, true);
		Checkbox darkGray = new Checkbox("",group, true);
		Checkbox black = new Checkbox("",group, true);
		Checkbox red = new Checkbox("",group, true);
		Checkbox pink = new Checkbox("",group, true);
		Checkbox orange = new Checkbox("",group, true);
		Checkbox yellow = new Checkbox("",group, true);
		Checkbox green = new Checkbox("",group, true);
		Checkbox magenta = new Checkbox("",group, true);
		Checkbox cyan = new Checkbox("",group, true);
		Checkbox blue = new Checkbox("",group, true);
		
		//Set backgroun d colours using corresponding static colour
		white.setBackground(Color.white);
		lightGray.setBackground(Color.lightGray);
		gray.setBackground(Color.gray);
		darkGray.setBackground(Color.darkGray);
//		black.setColor(Color.black);
		black.setBackground(Color.black);
		red.setBackground(Color.red);
		pink.setBackground(Color.pink);
		orange.setBackground(Color.orange);
		yellow.setBackground(Color.yellow);
		green.setBackground(Color.green);
		magenta.setBackground(Color.magenta);
		cyan.setBackground(Color.cyan);
		blue.setBackground(Color.blue);
		
		// Add radio buttons to panel
		add(white);
		add(lightGray);
		add(gray);
		add(darkGray);
		add(black);
		add(red);
		add(pink);
		add(orange);
		add(yellow);
		add(green);
		add(magenta);
		add(cyan);
		add(blue);
	}
}
		
public class PaletteApplet extends Applet
{
	Panel textOriginPanels[];
	Panel textOriginPanel;

	public void init()
	{
		Palette pal = new Palette();
		add(pal);
		repaint();
		
		String[] astrFontList = Toolkit.getDefaultToolkit().getFontList();
		for (int ii=0;ii<astrFontList.length; ii++)
		{
			System.out.println(astrFontList[ii]);
		}
	}
	
	public void paint( Graphics g )
	{
		g.drawString( "Hello World!", 30, 30 );
	}
	
}
