A FEW WEEKS ago, a murder trial was conducted in complete secrecy in Hanover County, Virginia, and a defendant, whose previous conviction had been reversed on appeal, was acquitted of killing a motel manager. We have no way of knowing whether justice was done or whether the secrecy at the latest trial contributed to the change in the jury's view of the case. But we do know that the exclusion of the public and the press from that trial was a remarkable departure from 200 years of American history.

The rationale for closing the trial was that the defendant could not get a fair hearing if the public and the press weer present. Two previous trials, after the first conviction had been reversed, were aborted by the judge, in one instance because of what he regarded as prejudicial publicity. His solution this time was to lock out the public rather than to lock up the jury so its members could not be exposed to any publicity. The Virginia Supreme Court has been asked to rule on the validity of his order.

The judge's decision was not surprising. Ever since the Supreme Court indicated two years ago that secrecy in some court proceedings may be permissible, local judges around the country have been closing their doors, in almost any kind of situatio5, when a defendant asked them to. The highest courts of New York and Pennsylvania, for example, have upheld the authority of judges -- and they are using it frequently -- to conduct secret pretrial proceedings on the admissibility of confessions and evidence. In that atmosphere, even though the Supreme Court is now reviewing the New York decision, it was inevitable that, someday, some judge would decide to conduct an entire criminal trial in secret.

What is going on here is a shift in judicial sentiment about the meaning of the constitutional guarantees of a "public trial." It used to be that almost no one questioned the right of the public or, at least, some of its representatives to be in the courtroom at all times. But in recent years judges have begun to think that the public-trial guarantee belongs only to defendants: They can waive it if they want to, the argument goes, and the public then has no right to know contemporaneously what is happening in its courts.

That argument has always seemed to us to fly in the face of both logic and history. The public trial is a mechanism to ensure justice for both defendants and the public; secrecy can be a cover either to railroad a defendant to jail or to defraud the public of the impartial administration of the courts. The fact that until this winter the Supreme Court had never considered the meaning of that "public trial" guarantee underlines the rarity of secret trials in American history and the abhorrence of them in earlier times. Indeed, 20 years ago judges generally refused to follow the lead of the New York Court of Appeals when it said only a defendant could insist that a trial be public.

Both the U.S. Supreme Court and the Supreme Court of Virginia now have a chance to put a stop to this shift toward secrecy in the courts. They should seize it, bearing in mind Lord Acton's comment that "everything secret degenerates, even the administration of justice...." The strength of the judicial system rests on public confidence in its integrity, and the judges should have learned from the recent example of the executive branch how quickly that confidence can be undermined by excessive secrecy.