About Me

My photo
Drum & Bass Producer, Software Developer, Love my Cats

How to Get Screensize

In many cases you wish your application to start in different places on the user's screen.
The following line does just that:
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
A nice use is putting a form in the middle of the screen:
setLocation(dim.width / 2 - this.getWidth() / 2, dim.height / 2 - this.getHeight() / 2);