'Fixes' to UI problem in Java 7.

Aesthetically, the problems aren't so visible with the painting issues. I'll try to resolve this properly at a later point, however there is so little useful information on the issue, making it hard to figure this out.