JFrame CenterLaied

frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
Nice Newt