posted 21 years ago
If you are using a JDK 1.4 or newer, you can just pass null into the setLocationRelativeTo() method and the frame will be centered automatically.
Otherwise, you'll have to use setLocation() or setBounds() and use Toolkit.getScreenSize() to calculate the location to put the frame.
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.