Bessel beams with tunable spot size are desirable for many applications such as laser material processing, optical trapping, and imaging. In this paper, we report experimental and simulation results of using a segmented deformable mirror to generate zero- and higher-order Bessel beams that have a controllable transverse and longitudinal shape. The tilt angle and piston position of the mirror segments are optimized to recreate the phase structure of a reflective axicon. Zero-order Bessel beams are generated at various beam converging angles, and their core diameter, peak intensity, and depth-of-focus are found to agree with the calculated results. By applying a phase ramp along the azimuthal direction, the first-order Bessel beam is generated with the characteristic annular shape. Because deformable mirrors have low absorption and dispersion and operate at a fast frame rate, they are a promising candidate for spatial beam shaping of high-power ultrafast lasers, which are used in material processing applications.