/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author STUDENT */ // Fig. 13.25: BorderLayoutDemo.java // Demonstrating BorderLayout. import java.awt.*; import java.awt.event.*; import javax.swing.*; public class BorderLayoutDemo extends JFrame implements ActionListener{ private JButton buttons[]; private final String names[] = {"Hide North", "Hide Sounth", "Hide East", "Hide West", "Hide Center"}; private BorderLayout layout; //set up GUI and event handling public BorderLayoutDemo() { super("BorderLayout Demo"); layout= new BorderLayout(5,5);// 5 pixel gaps //get content pane and set its layout Container container=getContentPane(); container.setLayout(layout); //instantiate button objects buttons=new JButton[names.length]; for (int count=0; count