1  import java.applet.Applet;
  2  import java.awt.*;
  3  
  4  public class BorderLayout4 extends Applet {
  5    Button EastButton, NorthButton, CenterButton;
  6  
  7    public void init() {
  8      // instantiating the button objects
  9      EastButton = new Button("East");
 10      NorthButton = new Button("North");
 11      CenterButton = new Button("Center");
 12  
 13      /* setting layout to BorderLayout 
 14         with 50 horizontal and 100 vertical pixels of spacing */
 15      setLayout(new BorderLayout(50,100));
 16      
 17      // order is not important here as we are specifying the positions
 18      add("East", EastButton);
 19      add("North", NorthButton);
 20      add("Center", CenterButton);
 21    }
 22  }
 23  
 24