Fix jdk constants incompatibility + event handlers