Java exception events (Definition)

Exceptions in Java applets can trigger JavaScript code in the containing web page.

A Java exception can be coupled to JavaScript handlers using the Netscape BeanConnect technology built into Netscape 4.0 browsers.

This can be used without a great deal of effort on the part of the Java applet programmer. A Java exception could cause a trigger for a call-back event at any time. This may be a way to develop more sophisticated scheduling machines although if you are going to that much trouble, you might choose to implement the bulk of your functionality in the applet itself.

However, this may yield a solution to the portability issues with media players. Given that the providers of the different media players generally provide an API, you may be able to hide the complexity of the different players by embedding the video inside an applet. This would allow you to normalise the JavaScript API it presents to the outside worlds and also deal with any cross-platform problems.

The applet becomes the player but deals with all the differences between different video players and all the nasty cross-platform stuff gets dealt with by the JVM. It's certainly feasible to embed QuickTime inside Java and there also a kit for doing the same with Real Player. Windows media player may be more tricky.

See also:Event, Java, JavaScript embedded in Java


Wrox Instant JavaScript - page - 56

Wrox Professional JavaScript - page - 549