BorderLayout divides the window into five regions

# BorderTest.java Five buttons arranged by BorderLayout
BorderLayout divides the window into five regions: NORTH, SOUTH, EAST, WEST, and CENTER. 
/./././././././././././././
import java.applet.Applet;
import java.awt.*;

/** An example of BorderLayout.
 *
 &&&&&&&&&&&&&&&&&&&&&&&&&&&

public class BorderTest extends Applet {
  public void init() {
    setLayout(new BorderLayout());
    add(new Button("Button 1"), BorderLayout.NORTH);
    add(new Button("Button 2"), BorderLayout.SOUTH);
    add(new Button("Button 3"), BorderLayout.EAST);
    add(new Button("Button 4"), BorderLayout.WEST);
    add(new Button("Button 5"), BorderLayout.CENTER);
  }
}
&&&&&&&&&&&&&&&&&&&&

Permanent link to this article: http://bangla.sitestree.com/borderlayout-divides-the-window-into-five-regions/

Leave a Reply