Java - Border Layout using Frame Demo
This Program is used to Demonstrate the Border Layout.
// Border Layout
import java.awt.*;
import java.awt.event.*;
public class bord extends Frame
{
Button b1,b2;
Label l1,l2;
TextField t1;
bord()
{
setLayout(new BorderLayout());
b1 = new Button("one");
b2 = new Button("two");
l1 = new Label("Name : ");
l2 = new Label("Place : ");
t1 = new TextField();
add(b1,BorderLayout.NORTH);
add(b2,BorderLayout.SOUTH);
add(l1,BorderLayout.WEST);
add(l2,BorderLayout.EAST);
add(t1,BorderLayout.CENTER);
addWindowListener(new w());
setSize(200,200);
setVisible(true);
}
class w extends WindowAdapter
{
public void windowClosing(WindowEvent we)
{
System.exit(0);
}
}
public static void main(String arg[])
{
bord ff = new bord();
// ff.show();
// ff.setBounds(0,0,300,300);
}
}


