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