Fix java gray window problem.