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

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

    JPanel panel = new JPanel(new BorderLayout());
    panel.add(new JButton("Page Start"), BorderLayout.PAGE_START);
    panel.add(new JButton("Page End"), BorderLayout.PAGE_END);
    panel.add(new JButton("Line Start"), BorderLayout.LINE_START);
    panel.add(new JButton("Line End"), BorderLayout.LINE_END);
    panel.add(new JButton("Center"), BorderLayout.CENTER);        

    frame.setContentPane(panel);
    frame.pack();
    frame.setVisible(true);
  }
}