Gunshot fired in court, judge takes cover