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

 public class FlowLayoutTestiSWF_2000 extends JFrame implements ActionListener
 {
 private JButton B[];
 private Container c;

 public FlowLayoutTestiSWF_2000()
 {
 super("Flow Layout formatlama Grafik ara yüz (GUI) testi");
 c=getContentPane();
 c.setLayout(new FlowLayout());
 B=new JButton[3];
 B[0]=new JButton("Sol");
 B[1]=new JButton("Orta");
 B[2]=new JButton("Sağ");
 for(int i=0;i<B.length;i++)
 {
 B[i].addActionListener(this);
 c.add(B[i]);
 }
 }

 public void actionPerformed(ActionEvent e)
 {
 int pozisyon=FlowLayout.LEFT;;
 if(e.getSource()==B[0])
 {
 pozisyon=FlowLayout.LEFT;
 }
 else if(e.getSource()==B[1])
 {
 pozisyon=FlowLayout.CENTER;
 }
 else if(e.getSource()==B[2])
 {
 pozisyon=FlowLayout.RIGHT;
 }
 c.setLayout(new FlowLayout(pozisyon));
 c.validate();
 }
      public static void main(String[] args)
      {
      FlowLayoutTestiSWF_2000 pencere= new FlowLayoutTestiSWF_2000();
      pencere.addWindowListener(new BasicWindowMonitor());
      pencere.setSize(350,200);
      pencere.setVisible(true);
      }
 }