For 15 years, since the days when he first learned the paces of the old brick county courthouse as a young law clerk, Prince George's Sen. John J. (Jack) Garrity has had one bright dream: to be a judge.

He wanted to be a judge back in 1970, when his old friends Peter O'Malley and Steny Hoyer, the leaders of the Prince George's Democratic organization, persuaded him to run for the County Council instead, saying it was for the sake of the party.

He let his ambition slip away again in 1978, when his name was before the governor for a judicial appointment and he withdrew it, again at the organizations request, this time because they wanted him to fill an empty seat in the state Senate.

Now, this month, there is an opening on the county District Court. Jack Garrity wants it badly. From his office in the Senate building here, Garrity has been calling his old friends and, at last, asking for his due. Once already, he was walked up to the second floor of the State House to talk to the governor. At 46, after a decade of sacrifices, near-misses and denials, Garrity's quest has begun in earnest.

"I feel as though I deserve it," he says. "I've worked hard for everything I've ever gotten, and it hasn't come easy. I have what it takes to be a good judge."

Garrity, short, gray-haired, and sharp-featured as his Irish ancestors, is lounging against the marbled wall outside the state Senate chambers one recent evening. He is chatting casually and inevitably, his mind turns to the opening.

"You're headed for Judge [James M.] Rea's slot, aren't you?" a colleague asks.

"Yes," says Garrity, "he was elevated to the Circuit Court, and so now it's my turn to go into the District Court."

"Have you traded away every vote this session to Gov. Hughes?" he is asked.

"Sure," says Garrity.

Garrity may be joking, but others in his position would not be. The selection of judges in Maryland is as much a political event as a full-blown race for elected office. Candidates file with local judicial nominating commissions, which are lobbied by elected officials and by the local bar association, which in Prince George's conducts its own popularity contest. Then, after the nominating commission narrows the field to a group of two to seven finalists, the governor makes a choice, subject to the approval of the Senate.

In addition to working on the governor, a lawyer who wants to be appointed a judge in Prince George's must also work hard on the 500-plus members of the bar association. In past years, the winner of the bar association poll invariably was recommended to the governor by the Democratic political organization, and governors before Hughes by and large chose the candidates the political organization wanted -- regardless of what the nominating commission did.

Garrity has tried to make his case with the county bar members and his fellow state senators. He called Winfield Kelly Jr., the former county executive, and influential County Council member Gerard T. McDonough to ask that they make calls to lawyers for him. Both complied.

Then he went to his longtime political ally and friend, De. Gerard Devlin, a prominent Bowie lawyer, to ask for help.

Devlin was in an awkward position. "I told him I couldn't help him because my law partner, Al Lochte, is also running for the slot," Devlin recalled.

"So he asked me to tell Lochte to get out of the race. I said I couldn't do that, and he got a little irritated at me. I think it's the first time he's ever been put out at me, and we've been friends for 20 years."

Garrity has been asked to drop out of the race by lobbyists for other candidates, most notably those of Joseph Casula, the brother of County Council member Frank Casula and the chosen favorite of the county's legal inner circle.

But Garrity has no intention of dropping out. "I've backed off several other times for the sake of others," he says. "And I've taken political office when my first desire was for the bench. I've sacrificed everything in the name of public service -- even my practice. I hoped that this would be my opportunity."

He is frustrated and tired in the state Senate. It consumes, he says, "90 percent of my time" and brings him slight financial reward at a time when he is sending both his sons through college. A legislator makes $16,000 annually; a District judge makes $38,000. Garrity could use the money.

But Garrity's quest is not primarily for money; it is for pride. An orphan at 9 who worked his way through high school, college and law school, Garrity scrapped his way through the county state's attorney's office and the state attorney's office and as a young man, and cut himself a niche as one of the state's few specialists in appellate court work.

It is a niche he treasures. More than anything else, Garrity has wanted all along to get out of politics, get on the bench, and work his way up to a seat on a state appellate court, such as the Court of Appeals.

In the past, he has always been sidetracked by his dedication to his friends. Garrity met O'Malley, Hoyer and Devlin before he ever became a lawyer, and they all joined the Prince George's Young Democrats together in the 1960's. When they have come to him -- as they have three times -- to ask that he run on a Democratic ticket for office, Garrity has never been able to say no.

But all along, he felt he was paying his dues -- to the party, to the lawyers and to the county. "I felt that there would be another day for me to go for a judgeship," he says now. And this month, he feels that his time should have come.

Most members of the Democratic legal establishment in Prince George's agree that Jack Garrity deserves to be a judge.

But this time, at least, the outlook is not good for Garrity, and he knows it. Somehow, the system has turned around on him.

To begin with, Garrity did not do well on the bar association vote last Wednesday. Out of 12 candidates he finished sixth in number of "most qualified" votes. Casula had 223 ballots in that category; Garrity had 31.

Garrity did not do well because in Prince George's, many lawyers resent colleagues who become politicians, and do not believe they should be judges. "We lawyers here can be a snobbish group," explains county Circuit Court Judge Vincent Femia, "and Jack's problem is that he is a quote-unquote politician.It's nonsensical, but that's how a lot of lawyers here look at it."

In the past, Garrity might have been able to look to the county's Democratic political organization -- the Hoyers and O'Malleys -- to counteract that negative point. But his old friends are at least temporarily retired from politics now, and the organization -- which used to have a heavy weight in judicial selections -- was dismantled by the last election.

Even worse, Gov. Harry Hughes, who will make the final appointment, has shown a distant bias, in the view of many, against appointing lelgislators to judgeships -- unlike his predecessors. Garrity was so worried on this point that he went to see Hughes for an assurance that he would not be counted out simply because he was a state senator.

And so, ironically, Garrity is finding out that by following the traditional roads to success in county and state politics, by doing everything he thought he should have, he may, in the changing times, have cut himself off from the goal he was seeking all along.

He is a little bitter about it. "It is ironic, and it hurts me, it cuts me to the quick," he says. "Public office should enhance one for a judgeship. But now these other attorneys are sitting back and making a fortune and not getting involved, and then looking at me and saying 'politics,' like it was a dirty word.

"They fail to realize thay my whole life has been working with people. And that the most political group I know of in this nation is the Prince George's County bar association."

Garrity admits that he might not become a judge this time. Casula might get the slot. But he says he will not give up his quest.

"If I don't get it, I'll try again," he says. "Maybe for the new Circuit Court position that's going through the legislature. I have confidence in the judicial commission. Sooner or later, I'll be given an opportunity.

"I just keep trying. That's my pattern. That's how I've gotten to where I am. And I wouldn't stop trying, by God, no matter what."