The judge said: "Your behaviour really was appalling."