Jframe Centerlaised

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