

/********************************************************************************
Report dialog
----------------------------------------------------
Copyright (c) Gunnar Gotshalks. All Rights Reserved.

Permission to use, copy, modify, and distribute this softwareand its
documentation for NON-COMMERCIAL purposes and without fee is hereby granted. 
********************************************************************************/

package FlexOr.utility;

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

@SuppressWarnings("serial")
public class ReportDialog extends Dialog {
  
  public ReportDialog(Frame f, String title) {
    super(f, title, false);

    textarea.setFont(new Font("Monospace", Font.PLAIN, 10));
    add(textarea, BorderLayout.CENTER);

    ButtonAdapter ok =
       new ButtonAdapter("Ok") {
          public void pressed() { dispose(); }
       };
    ok.setBackground(Color.white);
    add(ok, BorderLayout.SOUTH);

    addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) { dispose(); }
    });
    
    pack(); setVisible(true);
  }

  
  TextArea textarea = new TextArea("", 10, 50, TextArea.SCROLLBARS_BOTH);

  public void display() { pack(); setVisible(true); }
  
  public void add(String msg) { textarea.append(msg); }
  
  public void addln(String msg) { textarea.append(msg+"\n"); setVisible(true); }

  public void setFont(Font font) { textarea.setFont(font); }

}
