It was a rare encounter between a judge and a defendant who has just been convicted of a felony charge with a possible five-year prison term.

"I just want to thank your honor for your incredible comprehension of this case," the defendant, Joel L. Kaplan, told Arlington Circuit Court Judge Paul D. Brown as both men left the courtroom moments after Brown, visibly startled, smiled but said nothing.

For Kaplan, 31, a brash Northern Virginia private detective, it was a characteristic ending to this week's three-day trial, which ended yesterday with his conviction on a charge of possessing illegal wiretapping equipment. Kaplan said he plans to appeal.

"He designed (the equipment) and built it right on-site," said Brown, who added that "beyond a reasonable doubt that design was for surrepitious interception" of telephone conversations.

Kaplan, the head of Action Investigative Services of Alexandria, a firm specializing in divorce and child custody cases, will be tried in December in Arlington Circuit Court on a separate charge of possessing illegal wiretapping equipment. He also faces two charges of illegal wiretapping in Prince William County stemming from his alleged role in a divorce case. Kaplan, whose firm's motto is "Specializing in Difficult Situations" has pleaded innocent to all charges.

According to tape recordings introduced during the trial, Kaplan boasted to undercover D.C. police detective Michael E. Hubbard that he had performed more than 7,000 wiretaps and possessed sophisticated surveillance equipment "far superior to any federal agency with the possible exception of the DEA (Drug Enforcement Administration)."

"I really, on the evidence, doubt that several thousand phone calls were intercepted (by Kaplan) but there were doubtless a fair number," said Brown, who dismissed a charge of attempted illegal wiretapping against Kaplan earlier in the trial.

Under Virginia law, wiretapping is illegal without the consent of the telephone subscriber except when authorized by court order and performed by law enforcement officials.

Hubbard, poising as "Mike Lewis," a D.c. private eye, met Kaplan at a conference at the Watergate several months ago. Last April, Hubbard testified, he asked Kaplan for help with a fictitious divorce case. He said he told Kaplan that his client, a young woman who was in reality an Arlington police officer, was seeking proof of her husband's infidelity for use in a divorce case.

According to Hubbard, Kaplan installed bugging devices on a telephone located in a North Arlington garden apartment rented by the county police department and in the trunk of a car parked in front of the apartment which was to receive and record the phone calls. He was arrested a short time later.

In his closing argument yesterday, Kaplan's attorney David Sher argued that the equipment Kaplan possessed was legal because it is available commercially and can be used legally by radio operators and others. But Brown disagreed, saying that "common sense rejects those possible uses."

Sentencing is set for Nov. 20.