BUSHNELL, Fla. — James R. White, a Marine Corps veteran in a blue uniform, saluted crisply as the honor guard marched around the courtyard, stopped and marched again.

But there were no weapons in sight here. No polished shoes. No gleaming caps. The 85 men standing at attention wore prison garb. When the ceremony was over, they ambled back to their wing of Complex 1, a housing area set aside for military veterans serving time at Sumter Correctional Institution, a maximum-security prison in rural central Florida.

Florida is one of a handful of states that are rethinking their treatment of incarcerated veterans in the hopes of easing their transition back to society and then keeping them out of prison for good. In August, the state created a program that provides separate dorms in five prisons for honorably discharged military veterans who have no more than three years left on their sentences and who volunteer for it. California and Illinois have similar programs, all designed to address the needs of imprisoned veterans better.

For now, 300 of Florida’s 6,700 incarcerated veterans live in the dorms, a number that state officials intend to increase. The state prison system houses 101,000 inmates in all.