// Demonstrating Border Layout and Panel

import java.awt.*;
import java.applet.*;
import java.awt.event.*;

public class MyLabel extends Applet implements ActionListener
{
	Panel panel1 = new Panel();
	Panel panel2 = new Panel();
	Button button1 = new Button("Copy");
	Button button2 = new Button("Paste");
	
	Label label = new Label("Press the Buttons");
	
	// method called by the browser of appletviewer when an applet is going to be executed
	
	public void init()
	{
		// create a border layout
		setLayout(new BorderLayout());
		//add the actionlistener
		button1.addActionListener(this);
		button2.addActionListener(this);
		
		panel1.add(label);
		panel2.add(button1);
		panel2.add(button2);
		
		//positionpanel on the border Layout
		add("North",panel1);
		add("Center",panel2);
	}
	
	public void actionPerformed(ActionEvent e)
	{
		// perform action 
		String display=e.getActionCommand();
		label.setText(display);
	}
	
} //END			