import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
 public class GridLayoutTestiSWF_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"};
 private Container c;

 public GridLayoutTestiSWF_2000()
 {
 super("Grid Layout formatlama Grafik ara yüz (GUI) testi");
 c=getContentPane();
 c.setLayout(new GridLayout(3,2,5,5));
 B=new JButton[6];
 for(int i=0;i<B.length;i++)
 {
 B[i]=new JButton(S[i]);
 B[i].addActionListener(this);
 c.add(B[i]);
 }
 }

 public void actionPerformed(ActionEvent e)
 {
 for(int i=0;i<B.length;i++)
 {
 if(e.getSource()==B[i])
 B[i].setVisible(false);
 else B[i].setVisible(true);
 }
 c.validate();
 }
      public static void main(String[] args)
      {
      GridLayoutTestiSWF_2000 pencere= new GridLayoutTestiSWF_2000();
      pencere.addWindowListener(new BasicWindowMonitor());
      pencere.setSize(400,200);
      pencere.setVisible(true);
      }
 }

