Logo    
how to work how to live how to play how to use stuff how to keep health

How to Center application on the screen

poster:how to do,from:how to do

Centering an application (window, frame or dialog) can be done with the following codes:

// 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);





howtd give you the best answers,this article about

How to Center application on the screen.

if it can help you,please collect it or send to your friends.


Copyright 2006 howtd.com. All rights reserved.
privacy - contact us