import javax.swing.*;
import java.awt.*;
import java.awt.event.*; // for WindowEvent class
public class CrashDialog 
{
	public CrashDialog()
	{
		JDialog dialog = new JDialog();
		dialog.setTitle("Aieee!!");
		JLabel label = new JLabel("Your program has just crashed. Tough luck!");
		label.setHorizontalAlignment(SwingConstants.CENTER);
		dialog.getContentPane().add(label);
		dialog.setSize(300,100);
		dialog.setVisible(true);
	
		// ignore this for now-- it simple exits the
		// application when the dialog is closed
		dialog.addWindowListener(new WindowAdapter()
		{
			public void windowClosing(WindowEvent evt)
			{
				System.exit(0);
			}
		});
	}
	public static void main(String[] argv)
	{
		CrashDialog cdialog = new CrashDialog();
	}
}
