TWS weird Java 1.6.1 issue

I use NinjaTrader to place orders via TWS API. I have recently upgraded to java version to 1.6.1, and it caused a strange behavior. After Ninja establishes the connection to TWS, any window that I select get unselected within 1 second and the control goes back to TWS window even if it minimized, so it obviously prevented me from trading on Ninja DOM or using anything other. The moment I reversed back to 1.5.11, everything went back to normal. Lesson learned, I guess no Java 1.6 upgrade in the future for me.