Man charged with taking knives into court to kill judge