*****************************************************************
COMPLETE SOURCE CODE FOR : EasiestWayToMakeJFrameCenter.java
*****************************************************************
import javax.swing.JFrame;
public class EasiestWayToMakeJFrameCenter
{
public static void main(String[]args)
{
JFrame frame=new JFrame("Easiest way to make JFrame center");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(500,400);
//setLocationRelativeTo(null) will make JFrame get to the center
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
}
*****************************************************************
JUST COMPILE AND EXECUTE IT
*****************************************************************