how to set a JFrame to open in center code example Example: open jframe in center of screen add this after setbounds setLocationRelativeTo(null);