Judge commits defendant to State Hospital