import java.applet.Applet; import java.awt.*; public class BorderLayout2 extends Applet { Button EastButton, WestButton, NorthButton, SouthButton; public void init() { // instantiating the button objects EastButton = new Button("East"); WestButton = new Button("West"); NorthButton = new Button("North"); SouthButton = new Button("South"); /* setting layout to BorderLayout with horizontal and vertical spacing of 10 pixels */ setLayout(new BorderLayout(10,10)); // order is not important here as we are specifying the positions add("East", EastButton); add("West", WestButton); add("North", NorthButton); add("South", SouthButton); } }