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

/**
 * A window with four buttons and a text area.
 */
public class BorderJFrame extends JFrame {

  /** North button. */
  JButton northButton;

  /** South button. */
  JButton southButton;

  /** East button. */
  JButton eastButton;

  /** West button. */
  JButton westButton;

  /** Text area, in the center. */
  JTextArea centerArea;

  /**
   * Create four buttons in the north, south, east, and west, and
   * create a 10x20-character text area in the center.
   */
  public BorderJFrame() {
    // Create the four buttons and the text area.
    this.northButton= new JButton("north button");
    this.southButton= new JButton("south button");
    this.eastButton= new JButton("east button");
    this.westButton= new JButton("west button");
    this.centerArea= new JTextArea("Center", 10, 20); // 10 chars wide, 20 lines high.

    // Add the buttons and the text area to this window.
    Container c= this.getContentPane();
    c.add(this.eastButton, "North");
    c.add(this.northButton, "South");
    c.add(this.centerArea, "East");
    c.add(this.southButton, "West");
    c.add(this.westButton, "Center");

	this.pack();
  }

}

