fix issue using a modern version of swing related to when the visibility callbacks happen