You should set the location of the internal frame.
Dialogs that are internal frames should be implemented using JOptionPane or JInternalFrame, not JDialog.
To create a simple dialog, you can use the JOptionPane showInternalXxxDialog methods.
Internal frames fire internal frame events, not window events.