i hope this will be helpful.
put this on the top of source code :
import java.awt.Toolkit;
and then write this code :
private void formWindowOpened(java.awt.event.WindowEvent evt) {
int lebar = this.getWidth()/2;
int tinggi = this.getHeight()/2;
int x = (Toolkit.getDefaultToolkit().getScreenSize().width/2)-lebar;
int y = (Toolkit.getDefaultToolkit().getScreenSize().height/2)-tinggi;
this.setLocation(x, y);
}
good luck :)