posted 20 years ago
With JDK 1.4 you can use dialog.setLocationRelativeTo(null)
the "null" will make a dialog to appear on the center of the screen
If you're using JDK 1.3 you'd have to use something like:
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((int)(screenSize.getWidth()/2 - getSize().getWidth()/2),(int)(screenSize.getHeight()/2 - getSize().getHeight()/2));