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

class Button0 implements ActionListener {

  JButton button;
  JTextArea textArea;
    
  Button0(String title) {

    JFrame frame = new JFrame(title);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(200, 100);
    frame.setTitle(title);
    Container contentPane = frame.getContentPane();
    JPanel panel = new JPanel(new BorderLayout());
    contentPane.add(panel);

    textArea = new JTextArea();
    textArea.setText("Button");
    textArea.setLineWrap(true);
    Font f = new Font("SansSerif", Font.BOLD, 14);
    textArea.setFont(f);
    panel.add(textArea, BorderLayout.CENTER);

    button = new JButton();
    button.setText("Button");
    panel.add(button, BorderLayout.SOUTH);
    frame.setVisible(true);

    button.addActionListener(this);
  }

  public void actionPerformed(ActionEvent event){
    if(event.getSource() == button) {
      textArea.setText(textArea.getText() + " Button");
    }
  }

  public static void main(String args[]) {
    Button0 app = new Button0("SwingButton");
  }
}
