Airplanes, with their cramped quarters and crowded conditions, would seem improbable settings for sexual assaults, but recent news accounts show they do happen.

A Detroit-area man who was convicted of sexually assaulting a sleeping passenger during an overnight flight was sentenced to nine years in prison, and two men were charged in separate cases last year. In August, a female passenger described on Twitter how a man masturbated sitting next to her for hours.

And this week, two flight attendants for JetBlue filed a lawsuit in federal court against the airline and two of its pilots, alleging that the pilots drugged both attendants during a layover and that one of the pilots raped one of the women and a co-worker.

Laura Palumbo, communications director at the National Sexual Violence Resource Center in Harrisburg, Pa., said there was every reason to believe that sexual assaults and harassment on flights had started getting increased attention thanks to the #MeToo movement and after a 2016 report that Donald J. Trump, decades before he became president, sexually assaulted a businesswoman on a flight. (He denied the allegation.)