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

public class Panel10 extends Applet implements ActionListener
{

  private Panel buttonPanel;
  private Button buttons[];
  String s[]=
  {"Birinci Butona Basildi",
  "Ikinci Butona Basildi",
  "Ucuncu Butona Basildi",
  "Dorduncu Butona Basildi",
  "Besinci Butona Basildi",
  "Altinci Butona Basildi",
  "Yedinci Butona Basildi",
  "Sekizinci Butona Basildi",
  "Dokuzunccu Butona Basildi",
  "Onuncu Butona Basildi"};
  TextField T;
  public void init()
  {
  T=new TextField(s[0]);
  
  buttonPanel=new Panel();
  buttons=new Button[10];
  buttonPanel.setLayout(new GridLayout(2,buttons.length/2));
    for(int i=0;i<buttons.length;i++)
    {
    buttons[i]=new Button("Button "+(i+1));
    buttons[i].addActionListener(this);
    buttonPanel.add(buttons[i]);
    }
  setLayout(new BorderLayout());
  add(buttonPanel,BorderLayout.SOUTH);
  add(T,BorderLayout.NORTH);
  }

  public void actionPerformed(ActionEvent e)
  {
     for(int i=0;i<buttons.length;i++)
     { if(e.getSource()==buttons[i]) T.setText(s[i]);}
     validate();
  }


}
