View Javadoc

1   package fr.ove.errordialog;
2   
3   import java.awt.*;
4   import java.awt.event.*;
5   
6   /***
7   * A dialog box for error messages.<BR>
8   * The error messages must take the form of a <CODE>java.awt.Component</CODE>
9   * (and subclasses), that way sophisticated managment errors can be achieved.
10  *
11  * @author © 1998 DIRAT Laurent
12  * @version 1.0  13/04/99
13  */
14  public class ErrorDialog extends Dialog {
15  	public ErrorDialog(Frame parent, boolean modal)	{
16  		super(parent, modal);
17  		
18  		setLayout(new BorderLayout(0, 0));
19  		setTitle("Oups, we've got a problem...");
20  		
21  		addWindowListener(
22  		    new WindowAdapter()	{
23          		public void windowClosing(WindowEvent event) {
24          			dispose();
25              	}
26              }
27          );
28      }
29      
30      public void addMesg(Component mesg) {
31          add("Center", mesg);
32          validate();
33      }
34  
35  }