While JavaScript code is ultimately event driven


While JavaScript code is ultimately event driven, and intimately tied to its HTML environment, Java applets are much more independent. An applet may respond to a mouse click within its active area, but it won’t be listening for the sound of a Submit button being pressed.
An applet is a little application that lives in its own world, for the most part. JavaScript code is more like a Dynamically Loaded Library which is activated in response to something.