
 import java.applet.Applet;

 import java.awt.*;

 import java.awt.event.*;

 public class FlowLayoutTesti extends Applet implements ActionListener

 {

 private Button B[];

 public void init()

 {

 B=new Button[3];

 B[0]=new Button("Sol");

 B[1]=new Button("Orta");

 B[2]=new Button("Sag");

 for(int i=0;i<B.length;i++)

 {

 B[i].addActionListener(this);

 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;

 }

 setLayout(new FlowLayout(pozisyon));

 validate();

 }

 }