Link to home
Start Free TrialLog in
Avatar of gerry99
gerry99

asked on

Printing in IE4 and Netscape4

Netscape defines a set of classes to grant applets permissions to do specific things.  I use the PrivilegeManager.enablePrivilege method to request permissions for my signed applet.  Including these calls in my code causes IE4 to toss exceptions because it can't find the Netscape classes.  Java doesn't give me conditional complitation, and I don't want to maintain 2 sets of sources, one for each browser.

BTW, the Capablities API works fine with Netscape 4.05.

I can detect which browser my applet is running under.

Is there any way to use the Netscape classes from code that can be run without exceptions under IE4?
ASKER CERTIFIED SOLUTION
Avatar of msmolyak
msmolyak

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gerry99
gerry99

ASKER

This answer works, and it deserves to be called the "hack of all ages".  I'm not sure how the language specification should be changed, but as long as applets must make use of libraries that exist in some browsers, but not in others, some form of conditional compilation is required.  Notice that with this technique *all* the work must be done in a constructor, because if you wanted to call a method on this class, it would have to be loaded and verified on both platforms and would toss exceptions on the one that does not contain some of the classes that it uses.

Thanks,