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

public class whiteBoard extends Applet {
	Label wbTitle = new Label("White Board",Label.CENTER);

	public void init() {
		setLayout(new BorderLayout());
		wbPanel wp = new wbPanel();
		wbTitle.setFont(new Font("TimesRoman",Font.BOLD,18));
		add("North", wbTitle);
		add("Center", wp);
/* 1 */
		wb.setWb(wp);
		add("South",new wbControls(wp));
	}
}

class wbControls extends Panel {
	wbPanel target;

	public wbControls(wbPanel target) {
		this.target = target;
		Choice ink = new Choice();
		ink.addItem("Black");
		ink.addItem("Blue");
		ink.addItem("Red");
		add(ink);
    	}

	public boolean action(Event e, Object arg) {
		if (e.target instanceof Choice) {
			String choice = (String)arg;

			if (choice.equals("Red")) {
				target.setForeground(Color.red);
			} else if (choice.equals("Blue")) {
				target.setForeground(Color.blue);
			} else if (choice.equals("Black")) {
				target.setForeground(Color.black);
			}
		}
		return true;
	}
}
