import javax.swing.*;
import java.awt.BorderLayout;

public class UsefulPanel {
    public static void main(String[] args){
        JFrame frame = new JFrame();
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		// make a new panel, add some buttons to it, add it to the North part
		// of the BorderLayout
		JPanel panel = new JPanel();
		panel.add(new JButton("one"));
		panel.add(new JButton("two"));
		panel.add(new JButton("three"));
		// (you're supposed to add stuff to the content pane, not directly to
		// the frame)
		frame.getContentPane().add(BorderLayout.NORTH, panel);

		// Add a button to each remaining section of the layout manager
		frame.getContentPane().add(BorderLayout.SOUTH, new JButton("South"));
		frame.getContentPane().add(BorderLayout.EAST, new JButton("East"));
		frame.getContentPane().add(BorderLayout.WEST, new JButton("West"));
		frame.getContentPane().add(BorderLayout.CENTER, new JButton("Center"));

		frame.setSize(300, 200);
        frame.show();
    }
}
