import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
 public class BorderLayoutTestiSWF_2000 extends JFrame implements ActionListener
 {
 private JButton B[];
 private String S[]={"Kuzeyi Gizle","Güneyi Gizle","Doğuyu Gizle",
 "Batıyı Gizle","Ortayı Gizle"};
 private Container c;

 public BorderLayoutTestiSWF_2000()
 {
 super("Border Layout formatlama Grafik ara yüz (GUI) testi");
 c=getContentPane();
 c.setLayout(new BorderLayout(5,5));
 B=new JButton[5];
 for(int i=0;i<B.length;i++)
 {
 B[i]=new JButton(S[i]);
 B[i].addActionListener(this);
 }
 c.add(B[0],BorderLayout.NORTH);
 c.add(B[1],BorderLayout.SOUTH);
 c.add(B[2],BorderLayout.EAST);
 c.add(B[3],BorderLayout.WEST);
 c.add(B[4],BorderLayout.CENTER);
 }

 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)
      {
      BorderLayoutTestiSWF_2000 pencere= new BorderLayoutTestiSWF_2000();
      pencere.addWindowListener(new BasicWindowMonitor());
      pencere.setSize(400,200);
      pencere.setVisible(true);
      }
 }

