/*
	Trivial application that displays a string
*/
import java.awt.*;

import java.awt.event.*;
class MyPanel extends Panel implements ActionListener
{
	Button b1 = new Button("Turn On");
	MyPanel()
	{
		setLayout(new GridLayout());
		add(new Panel());
		add(b1);
		add(new Panel());
		b1.addActionListener(this);
	}
	
	public void actionPerformed (ActionEvent e)
	{
		if (e.getActionCommand() == "Turn On")
			b1.setLabel("Turn Off");
		else if (e.getActionCommand() == "Turn Off")
			b1.setLabel("Turn On");
	}
}

public class E2
{
	public static void main(String args[])
	{
		Frame f = new Frame();
		f.add(BorderLayout.NORTH, new Panel());
        	f.add(BorderLayout.SOUTH, new MyPanel());
	        f.add(BorderLayout.CENTER, new Panel());
        	f.show();
	}
}
