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

 public class JScrollPaneTestiSWF_2000 extends JFrame implements ActionListener
 {
 private JButton B[];
 private String S[]={"Düğme 1","Düğme 2","Düğme 3","Düğme 4",
 "Düğme 5","Düğme 6","Düğme 7","Düğme 8","Düğme 9","Düğme 10","Düğme 11",
 "Düğme 12","Düğme 13","Düğme 14","Düğme 15","Düğme 16"};
 private Container c;
 JScrollPane jscroll;
 JPanel jsp;

 public JScrollPaneTestiSWF_2000()
 {
 super("JScrollPane formatlama Grafik ara yüz (GUI) testi");
 c=getContentPane();
 c.setLayout(new BorderLayout(5,5));
 B=new JButton[16];
 jsp=new JPanel();
 for(int i=0;i<B.length;i++)
 {
 B[i]=new JButton(S[i]);
 B[i].addActionListener(this);
 jsp.add(B[i]);
 }
 jscroll=new JScrollPane(jsp);
 c.add(jscroll,BorderLayout.CENTER);
 }
 public void actionPerformed(ActionEvent e)
 {
 for(int i=0;i<B.length;i++)
 {
 if(e.getSource()==B[i])
 B[i].setText(S[i]+" düğmeye basıldı");
 else B[i].setText(S[i]);
 }
 c.validate();
 }
      public static void main(String[] args)
      {
      JScrollPaneTestiSWF_2000 pencere= new JScrollPaneTestiSWF_2000();
      pencere.addWindowListener(new BasicWindowMonitor());
      pencere.setSize(400,200);
      pencere.setVisible(true);
      }
 }

