I would like to know if there is an option to center a jframe to the center of the screen(monitor)? I have tried with co-ordinates but its not exact at the center. This is what I have:
Dimension ss = Toolkit.getDefaultToolkit ().getScreenSize ();
Dimension frameSize = new Dimension ( 800, 300 );
frame1.setBounds ( ss.width / 2 - frameSize.width / 2,
ss.height / 2 - frameSize.height / 2,
frameSize.width, frameSize.height );
PS:If the question is repeated please post the link.
Thank you.