View Single Post
  #2 (permalink)  
Old 11-02-2007, 03:57 PM
JavaBean's Avatar
JavaBean JavaBean is offline
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
Code:
// Get the size of the screen Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); // Determine the new location of the window int w = window.getSize().width; int h = window.getSize().height; int x = (dim.width-w)/2; int y = (dim.height-h)/2; // Move the window window.setLocation(x, y);
Reply With Quote