Flow Layout
      The FlowLayout is the default layout manager of Panel and Applet but we can also apply it to others by simpliy using setLayout method. In this program an implementation of flow layout is done.

import java.awt.*;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Nidhi
 */
public class FlowLayout {
    
    private Frame f;
    private Button b1;
    private Button b2;
    private TextField tf;
    
    public FlowLayout()
    {
        f = new Frame(" Flow Layout ");
        b1 = new Button(" button1 ");
        b2 = new Button(" button2 ");
        tf = new TextField("",20);
    }
    
    public launchFrame()
    {
        f.setLayout(new FlowLayout());
        f.add(b1);
        f.add(tf);
        f.add(b2);
        f.pack();
        f.setVisible(true);
    }
    
    public static void main(String args[])
    {
        FlowLayout fw = new FlowLayout();
        fw.launchFrame();
    }

 }
									

Download Program
Did You Know ?
IP address is a numerical label that is assigned to devices participating in a computer network. Read More