Blackstar_solar
Welcome to the
Java Ranch, we hope you�ll enjoy visiting as a regular however, your name is not in keeping with our
naming policy here at the ranch. Please
change your display name to an appropriate name as shown in the policy.
Thanks again and we hope to see you around the ranch!!
As for your question, to center the frame you need to get the screen dimensions then center your frame in it.
This will get the screen size:
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
You'll need to import the java.awt package to get the Dimension class.
Then just set the location of your object
setLocation(screenSize.width/2 - this.getWidth(),screenSize.height/2 - this.getHeight());
In order to use the getWidth and getHeight methods your class should extend either JFrame or some other component that is inherited from JComponent.
Hope that helps