
import java.awt.*;
import java.awt.event.*;


import javax.swing.text.*;
import javax.swing.event.*;
import javax.swing.*;

class Notepad1 extends JFrame {

  JTextArea editor;

 
  public Notepad1() {
     setTitle( "Notepad1");
     setBackground(Color.lightGray);
     setSize(600, 400);
     setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
     setGUI();
  } // Notepad1


  private void setGUI() {
  	//setBorder(BorderFactory.createEtchedBorder());
	  this.getContentPane().setLayout(new BorderLayout());

	  // create the embedded JTextComponent
    editor = new JTextArea("Hier ist ein Text\nHier die zweite Zeile");
	  editor.setFont(new Font("monospaced", Font.PLAIN, 24));

	  // Add this as a listener for undoable edits.
	  JScrollPane scroller = new JScrollPane(editor);
    this.getContentPane().add(scroller, BorderLayout.CENTER);

    scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    /*
      HORIZONTAL_SCROLLBAR_AS_NEEDED bzw.
      VERTICAL_SCROLLBAR_AS_NEEDED

      HORIZONTAL_SCROLLBAR_ALWAYS bzw.
      VERTICAL_SCROLLBAR_ALWAYS

      HORIZONTAL_SCROLLBAR_NEVER bzw.
      VERTICAL_SCROLLBAR_NEVER
    */

  }

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





}
