WASHINGTON — Judge Neil M. Gorsuch, President Trump’s nominee for the Supreme Court, privately expressed dismay on Wednesday over Mr. Trump’s increasingly aggressive attacks on the judiciary, calling the president’s criticism of independent judges “demoralizing” and “disheartening.”

The remarks by Judge Gorsuch, chosen by Mr. Trump last week to serve on the nation’s highest court, came as the president lashed out at the federal appellate judges who are considering a challenge to his executive order banning travel from seven predominantly Muslim countries. The president called their judicial proceedings “disgraceful” and described the courts as “so political.”

Those remarks followed Mr. Trump’s weekend Twitter outburst in which he derided a Seattle district court judge who blocked his travel ban as a “so-called judge” whose “ridiculous” ruling would be overturned.

Judge Gorsuch expressed his disappointment with Mr. Trump’s comments about the judiciary in a private conversation with Senator Richard Blumenthal, Democrat of Connecticut, as he paid courtesy calls on Capitol Hill to build support for his confirmation. An account of the discussion was confirmed by a White House adviser working to advance the Gorsuch confirmation, who spoke on condition of anonymity because he was not authorized to comment.