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

// 1. Beispiel mit TextField und Schaltern



public class Bsp_01 extends JFrame {

   JTextArea editor = new JTextArea("");
    JButton BnInput1 = new JButton("Input1");
    JButton BnInput2 = new JButton("Input2");
    JButton BnInput3 = new JButton("Input3");
   

    public Bsp_01() {
      setSize(600, 400);
      setLocation(100,100);
      setGUI();
    }

    private void setGUI() {
      editor.setFont( new Font("Arial", Font.BOLD,20)  );

      this.getContentPane().add( new JScrollPane(editor), BorderLayout.CENTER);
      BnInput1.setFont( new Font("Arial", Font.BOLD,18)  );
      BnInput2.setFont( new Font("Arial", Font.BOLD,18)  );
      BnInput3.setFont( new Font("Arial", Font.BOLD,18)  );

      JPanel pn = new JPanel();
      pn.setLayout ( new FlowLayout() );
      pn.add(BnInput1);
      pn.add(BnInput2);
      pn.add(BnInput3);

      this.getContentPane().add(pn, BorderLayout.NORTH);

      BnInput1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
          BnInput1_Click();
        }
      });
      BnInput2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
          BnInput2_Click();
        }
      });
      BnInput3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
          BnInput3_Click();
        }
      });
    }


  private void BnInput1_Click() {
  }

  private void BnInput2_Click() {
  }

  private void BnInput3_Click() {
  }

  //Überschreiben, damit das Programm bei Herunterfahren des Systems beendet werden kann
  protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if(e.getID() == WindowEvent.WINDOW_CLOSING) {
      System.exit(0);
    }
  }  // jbinit2

  public static void main(String[] args) {
    Bsp_01 frame = new Bsp_01();
    frame.setVisible(true);
 }

}



