/* Autor:           Dipl.-Inf., Dipl.-Ing. (FH) Michael Wilhelm
   Firma:           HS Harz, FB AI
   Version:         1.1
   Ersterstellung:  07.06.2006
   Letzte Änderung: 12.11.2010
*/

// Document Listener

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

import java.awt.event.*;
import com.borland.jbcl.layout.*;

// Plain Dokument
import javax.swing.text.PlainDocument;
import javax.swing.text.BadLocationException;
import javax.swing.text.AttributeSet;



import javax.swing.text.Document;
import javax.swing.event.DocumentListener;
import javax.swing.event.DocumentEvent;


public class Plausi11 extends JFrame implements DocumentListener {
  XYLayout xYLayout1 = new XYLayout();

  JLabel jLabel1 = new JLabel();
  JTextField TMatrikelNr = new JTextField();

  JButton BnOk = new JButton();
  JButton BnESC = new JButton();

  public Plausi11() {
  public Plausi1() {
    setSize(400, 200);
    setTitle("Plausibilität 11. Beispiel");
    setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    setGUI();
  }

  private void setGUI() {
    this.getContentPane().setLayout(xYLayout1);

    jLabel1.setText("MatrikelNr");
    TMatrikelNr.setText("-");


    BnOk.setText("Ok");
    BnOk.addActionListener(new java.awt.event.ActionListener() {

      public void actionPerformed(ActionEvent e) {
        BnOk_actionPerformed(e);
      }
    });
    BnESC.setText("Abbruch");
    BnESC.addActionListener(new java.awt.event.ActionListener() {

      public void actionPerformed(ActionEvent e) {
        BnESC_actionPerformed(e);
      }
    });

    xYLayout1.setHeight(200);
    xYLayout1.setWidth(400);
    this.getContentPane().add(jLabel1, new XYConstraints(21, 18, -1, -1));
    this.getContentPane().add(TMatrikelNr, new XYConstraints(115, 17, 257, -1));
    this.getContentPane().add(BnESC, new XYConstraints(206, 94, 85, -1));
    this.getContentPane().add(BnOk, new XYConstraints(81, 94, 95, -1));

    TMatrikelNr.getDocument().addDocumentListener( this );


  }


  //Ü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);
    }
  }


  public static void main(String[] args) {
    Plausi11 frame = new Plausi11();
    frame.show();
 }

  void BnOk_actionPerformed(ActionEvent e) {

  }

  void BnESC_actionPerformed(ActionEvent e) {
    System.exit(0);
  }

/*
    protected Document createDefaultModel() {
      System.out.println("---------------- createDefaultModel ------------------");
        gIntTextDocument doc = new gIntTextDocument();
        doc.addDocumentListener(this);
        return doc;
    }

*/
    public void removeUpdate(DocumentEvent e) {
      System.out.println("removedUpdate");
        /*
        if (getUpdateModus()) return;
        change();
        */
    }

    public void insertUpdate(DocumentEvent e) {
      System.out.println("insertdUpdate");
        /*
        if (getUpdateModus()) return;
        // Debug.print("GUI", Debug.INFO, " insertUpdate "+e.getType().toString() );
        change();
        */
    }

    public void changedUpdate(DocumentEvent e) {
      System.out.println("changedUpdate ");
        /*
        if (getUpdateModus()) return;
        change();
        */
    }



}



