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