That's because u r running your applet via Plugin. The deal is that
AppletContext is set by the environment applet is being run in. It
could be either a browser or a plug-in. For some reason plug-in
doesn't supply u with AppletContext. For some reason (and possibly
this follows the specs) Plugin does NOT supply Applet with any
AppletContext. But whatever the reason u needed the AppletContext object
for, u can do the same things via NN's LiveConnect technology. Now (if i'm not
mistaken, starting with JRE1.2.2) these classes are shipped together
with JRE, packed in jaws.jar. If u r using an older version of JRE,
these files are also can be found in NN's java30.jar/java40.jar in
netscape/Program/java/classes directory.

Well, in case u need to display some web page in the browser, below is
an extract that do this:

      JSObject win = JSObject.getWindow(ds);
      win.setMember("location", "http://www.sun.com/");

Where JSObject is a class of netscape.javascript package.

Actually via this object (specifically, via 'win' variable) u get
access to many functions/variables of JavaScript. But it's actually
much better and easier to call your own custom JavaScript function
from your applet once only, instead of manipulating with several
JavaScript 'native' functions directly. This way u get access to all
JavaScript functions (from your own custom JS function), plus, with
all actions programmed in that JavaScript function u call, u do not
need to recompile your program every time u decide to change the link
or an action, involving interaction with browser, in response to some
event in applet.

Useful links:
http://developer.netscape.com/docs/manuals/communicator/jsguide4/livecon.htm
http://java.sun.com/products/plugin/1.2/docs/tags.html
http://java.sun.com/products/plugin/1.2/docs/jsobject.html

And don't forget to set MAYSCRIPT to true in your EMBED/OBJECT
tags (see JPlugin spec - the second link)

vladimir
              -=V=-
>-------<=============>-------<
   Join Java community now!
http://JavaCafe.VirtualAve.net/
>-------<=============>-------<

In your previous letter u wrote:
--------------------------------
CH> Can anyone help me? I am tring to use the getAppletContext() method and
CH> having no luck. When I try and run the applet I keep getting a
CH> java.lang.NullPointerException error. The class I call getAppletContext from
CH> extends Applet.

CH> Thanks Charlie

CH> ===========================================================================
CH> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
CH> of the message "signoff JAVA3D-INTEREST".  For general help, send email to
CH> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to