FlowLayout

ALT= "Applet could not be loaded" Sorry, it is time to upgrade your browser to a Java powered one.


import java.applet.Applet;
import java.awt.*;

public class Flow extends Applet {
	private TextField t1, t2, t3, t4, t5, t6;
	private Panel p1, p2, p3;

	public void init()
	{
		p1 = new Panel();
		p2 = new Panel();
		p3 = new Panel();
		
		p1.setLayout( new FlowLayout (FlowLayout.RIGHT, 0, 10) );
		t1 = new TextField ( "Left ");
		t2 = new TextField ( "Field ");
		p1.add(t1);
		p1.add(t2);

		p2.setLayout( new FlowLayout (FlowLayout.LEFT, 10, 0) );
		t3 = new TextField ( "Right ");
		t4 = new TextField ( "Field ");
		p2.add(t3);
		p2.add(t4);

		p3.setLayout( new FlowLayout (FlowLayout.CENTER, 10, 10) );
		t5 = new TextField ( "Center ");
		t6 = new TextField ( "Field ");
		p3.add(t5);
		p3.add(t6);

		p1.setBackground (Color.pink);
		p2.setBackground (Color.red);
		p3.setBackground (Color.orange);
		add ( p1);
		add ( p2);
		add ( p3);
		
	}
}