Application of finite element methods in relativistic mean-field theory: spherical nucleus