TOKYO—A movie glorifying the life of a World War II kamikaze pilot recently topped the box-office charts in Japan for two months. Tokyo book stores have set up corners for titles disparaging Japan's neighbors. Anonymous authors with radical nationalist views, known as neto uyo, short for "right-wingers on the Internet," are thriving on Twitter and chat pages.

Across Japan, there are signs that the collective mood—long shaped by pangs of regret over World War II—is in the midst of a shift as tensions with rivals,...