import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class ButtonTestiSWF_2000 extends JFrame implements ActionListener
{
 private JButton B1,B2;
 private JTextArea cikti;
 private Container c;

 public ButtonTestiSWF_2000()
 {
 super("Buton (düğme) testi");
 c=getContentPane();
 c.setLayout(new FlowLayout());
 B1=new JButton("B1");
 B1.addActionListener(this);
 c.add(B1);
 B2=new JButton("B2");
 B2.addActionListener(this);
 c.add(B2);
 cikti = new JTextArea();
 cikti.setBackground(c.getBackground());
 c.add(cikti);
 }

public void actionPerformed(ActionEvent e)
{
if(e.getSource()==B1)
  {cikti.setText(" "+e.getActionCommand()+"düğmesine basıldı");}
else if(e.getSource()==B2)
  {cikti.setText(" "+e.paramString()+"düğmesine basıldı");}
}
      public static void main(String[] args)
      {
      ButtonTestiSWF_2000 pencere= new ButtonTestiSWF_2000();
      pencere.addWindowListener(new BasicWindowMonitor());
      pencere.setSize(350,200);
      pencere.setVisible(true);
      }

}




