Centering a window on the screen
Hello
I'm wondering how I can center a window on any screen no matter what its size or resolution. This is the code I've tried, but it doesn't work perfectly. It changes the window's size and no matter what value you divide it by it wont go in the center.
Toolkit theKit = this.getToolkit();
Dimension wndSize = theKit.getScreenSize();
this.setBounds(wndSize.width/3, wndSize.height/3, //Position
wndSize.width/5, wndSize.height/5); //Size
Please help me. I'm a n00b to Java by the way :)

