To change the intensity distribution of the fundamental mode in a Nd:YAG laser resonator to a top-hat profile we developed and used a dielectric graded-phase mirror. A super-Gaussian mode of the sixth order was generated by means of a graded-phase mirror with a simple ring-shaped phase step on a spherical reflector. The depth of the ring was 90 nm. Measurements with continuous-wave and repetitively pulsed diode-laser pumping were performed and compared. The results are in excellent agreement with the theory. To allow for real-time modification of the modes, adaptive optics such as deformable mirrors can be used. Experiments with an adaptive mirror featuring eight actuators on a glass substrate were performed. It was not yet possible to generate super-Gaussian modes with a deformable mirror but the beam quality in the multi-mode regime was improved significantly without closed-loop electronics. A reduction of the M2 value by 39 % was achieved.