change WindowListener to WindowAdapter