In his short White House tenure, President Trump has already set a record for histrionic tantrums against the media — whether attacking CNN, The Washington Post, The New York Times or MSNBC for revealing his 2005 tax return, as he did last week. He’s actually pursuing a well-worn path of American presidents blaming the press for their problems.

Five decades of reporting have taught me that whenever a president starts screeching about the media, it’s a sure sign he’s in hot water and fearing revelations about some policy disaster, damaging mendacity or political villainy. Even popular presidents with reputations for charming the press occasionally stoop to blaming the press for quagmires of their own making.

John F. Kennedy, for example.

In September 1963, with the Vietnam War escalating and the pro-American authoritarian regime of President Ngo Dinh Diem besieged by popular protests, President Kennedy used a private meeting with The New York Times’s publisher, Arthur Ochs Sulzberger, and James Reston, the Washington bureau chief, to charge that David Halberstam, the Times correspondent in Saigon, was undermining the American war effort and to pressure the publisher to pull Mr. Halberstam out of Vietnam. President Kennedy was particularly angered by a stream of front-page articles by Mr. Halberstam graphically describing battlefield defeats and the self-immolations of Buddhist monks.

What the president did not know was that The Times was already planning to replace Mr. Halberstam because the editors feared that Vietnamese secret police had marked him for assassination. Because I covered Vietnam policy in Washington, I had been told to get ready to replace Mr. Halberstam.