FileDocCategorySizeDatePackage
GUIErrorDialog.javaAPI DocGlassfish v2 API3887Fri May 04 22:35:22 BST 2007com.sun.enterprise.security

GUIErrorDialog

public class GUIErrorDialog extends JDialog

Fields Summary
String
message
private JButton
okButton
private JLabel
errorLbl
Constructors Summary
public GUIErrorDialog(String message)
Creates new form GUIErrorDialog

	super (new JFrame (), true);
	this.message = message;
	initComponents ();
	pack ();
    
Methods Summary
private voidcloseDialog(java.awt.event.WindowEvent evt)
Closes the dialog

        setVisible (false);
        dispose ();
    
private voidinitComponents()
This method is called from within the constructor to initialize the form.

        okButton = new javax.swing.JButton();
        errorLbl = new javax.swing.JLabel();
	okButton.setAlignmentX (CENTER_ALIGNMENT);
	errorLbl.setAlignmentX (CENTER_ALIGNMENT);
	getContentPane().setLayout (new javax.swing.BoxLayout (getContentPane (),BoxLayout.Y_AXIS));
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                closeDialog(evt);
            }
        }
        );
        
        okButton.setLabel("OK");
        okButton.setActionCommand("okButton");
        okButton.setText("OK");
        okButton.addActionListener (new ActionListener (){
		public void actionPerformed (ActionEvent e){
		    dispose ();
		}
	    });
	super.addWindowListener (new WindowAdapter (){
		public void windowClosing (WindowEvent we){
		    dispose ();
		}
	    });
        errorLbl.setText("Error : "+message);
	getContentPane().add (errorLbl);
	getContentPane().add (okButton);