import java.awt.*;

class mb_con extends Panel {
	// input data fields
	TextField Juliax,Juliay;
	mb applet;
	// form reset,  view change
	boolean Reset=false;
	boolean View=false;
	boolean ButtonPressed=false;

mb_con(mb parent,String L1,String L2)
	{
     // get hook to outer applet
	applet = parent;
     // set layout
	setLayout( new GridLayout(2,4,2,0));
	add(new Button("Julia"));
	add(new Button("Mandel"));
	Juliax = new TextField("0.0",7);
	add(new Label(L1, Label.RIGHT));	
	add(Juliax);
     // second row
	add(new Button("Reset"));
	add(new Button(""));
	Juliay = new TextField("0.0",7);
	add(new Label(L2, Label.RIGHT));	
	add(Juliay);
}	
public Insets insets() 
	{
	return new Insets(0,0,0,0);
	}//insets

public boolean action(Event evt,Object arg) {
	Reset=false;
	View=false;
	ButtonPressed=false;
	if (evt.target instanceof TextField) {
		applet.update(this);
		return true;
	} else
	if (evt.target instanceof Button) {
		ButtonPressed=true;
		String what_button = (String)arg;
		if (what_button.equals("Julia")) {
			applet.set_style=applet.julia_set;
			applet.update(this);
			}
		else if (what_button.equals("Mandel")) {
			applet.set_style=applet.mandel_set;
			applet.update(this);
			}
		else if (what_button.equals("Reset")) {
			Reset=true;
			applet.update(this);
			}
		else if (what_button.equals("View")) {
			View=true;
			applet.update(this);
			};
		return true;
	}
	else return false;
}//action
}//class mb_con
	