import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
import javax.swing.JButton;
import javax.swing.JDialog;
public void run()
{
- frame.show();
+ frame.setVisible(true);
}
}).start();
}
else
{
- frame.show();
+ frame.setVisible(true);
}
}
closeDialog();
}
});
-
+ frame.addWindowListener(new WindowListener()
+ {
+
+ @Override
+ public void windowOpened(WindowEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void windowIconified(WindowEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void windowDeiconified(WindowEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void windowDeactivated(WindowEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void windowClosing(WindowEvent e)
+ {
+ // user has cancelled the dialog
+ closeDialog();
+ }
+
+ @Override
+ public void windowClosed(WindowEvent e)
+ {
+ }
+
+ @Override
+ public void windowActivated(WindowEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+ });
}
/**
* clean up and raise the 'dialog closed' event by calling raiseClosed