Jump to Real's How-to Main page

Detect if Java 1.1 (with event delegation) is available

On some version of Netscape (eg.4.03), even if the JDK1.1 is reported as the Java version, you need to apply a special patch to upgrade to the event delegation model. Here how you can detect if the patch has been applied.
function isJava11Available() {
  if (java.awt.event.MouseEvent)
     return true;
  else
     return false;
}

Someone at Netscape suggests a better way to check :

function isJava11Available(){
  if (java.awt.event.MouseEvent == "[JavaClass java/awt/event/MouseEvent]")
     return true;
  return false;
}
because Unknown Java classes are reflected as JavaPackages, for reasons related to the fact that there's no way to tell if something is a valid package.
If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]