Asked by a moderator whether she would seek to appoint young progressive justices to the court to balance conservative appointments by Mr. Trump, she said she would.

“I want judges who believe in democracy, who believe in justice, who believe in the rights of individuals,” she said, “because that is the job of a justice.”

How to work (or avoid working with) Republicans

The Democratic candidates were repeatedly pressed by moderators to explain how they planned to make any changes to the courts or to enshrine threatened civil rights legislation into law if the Senate remained controlled by Republicans.

The most common answer involved winning elections. “If we don’t change Congress, we’re screwed.” Mr. Buttigieg said.

“Power is the only language the Senate G.O.P. responds to right now,” he said. “Our party’s sense of fair play has come back to bite us.”

Ms. Klobuchar argued that her experience in the Senate had given her insight into how to work the levers of Congress and, if necessary, to conduct a pressure campaign to get judicial openings filled with candidates of her choosing.

“It’s a game that’s been going on,” Ms. Klobuchar said. “You’ve got to be creative.”

Pledging to protect reproductive rights

All of the candidates staunchly backed a woman’s right to choose, and most pledged to do whatever they could to codify Roe v. Wade, the 1973 Supreme Court case that established theconstitutional right to abortion.