The Japanese have an overall low opinion of foreigners, especially those Japanese outside of the major metropolitan areas of Tokyo and Osaka. Many Japanese retail businesses routinely post their establishments for Japanese only and while the Japanese don't hate foreigners, they do love their own culture and nation. They do however judge foreigners on their behavior, and the most ill behaved foreigners are treated the most badly by Japanese.
Japan does have problems with foreigners, mostly Africans, Iranians and Arabs and the crime that permeates those groups who victimize with mostly property crimes. While the Chinese and other Asians fit in better, the Chinese are also know for their fraud rings and espionage, both corporate and traditional forms.
Furthermore, the Japanese know what is going on in the world, and radical Islamic terrorism and the continuing Muslim crime wave in Japan has got the Japanese gander up. And they are starting to fight back. (h/t Weasel Zippers)