Nationalism was a significant force in the way the United States related to Japan during WWII. Not only were the countries at war, but there was also a sense of distrust among many people.
In the case of Japan, due to the fact that the two countries were at war, POWs were kept by the Japanese government. The government did not want to appear inferior, and they also wanted to prove that Japan could be as developed and wealthy as any European power. This excessive pride was a consequence of the nationalism that was encouraged in Japanese politics during these years.
In the case of America, Japanese Americans were displaced and confined even though there was no evidence of their involvement in war activities. The government was afraid of their Japanese legacy, and they believed that if their heritage was Japanese, they were unlikely to be faithful to America. These people were victims of a different type of nationalism, as Americans had a very narrow view of what being an American was.