[3451] in java-interest
Re: Netscape 2.0b2/Java Interface: AppletContext.showDocument
daemon@ATHENA.MIT.EDU (thu@dq.IConNet.COM)
Mon Nov 13 16:32:01 1995
From: thu@dq.IConNet.COM
Date: Mon, 13 Nov 1995 09:59:30 -0500
To: java-interest@java.sun.com, magda@hobbes.hr.att.com
This is a bug in Netscape. I encountered the same problem. The URL was correctly past but you get NullPointerException when you call showDocument for the second time in each Netscape session. Don't waste your time on it.. nothing much you can do. =/
Is it just me or Netscape 2.0b2's Java support got even worse than b1J? A lot of classes that used to work simply don't anymore. =(
--- Tony Hu
> I'm having a problem with an applet which tries to get
> its AppletContext and run showDocument.
>
> I reduced the applet as much as possible (the applet code
> follows the error description).
>
> First some background: I'm running on a Sun Sparc 10
> under Solaris 2.3, using the Beta JDK (not pre-release)
> and Netscape Version 2.0b2.
>
> This runs fine the first time. I press the button and
> the Netscape window which contains the applet goes to
> my home directory.
>
> However, the next time I use the applet, whether it be
> on the same page (by going back) or even if I reload it
> on the top of the Netscape URL stack or even if I start a new
> Netscape browser window (same executable), it doesn't work.
> Basically, I must restart Netscape to have it work again.
> When it fails I get a java.lang.NullPointerException
> with the following stack trace:
>
> at netscape.applet.MozillaAppletContext.showDocument0(MozillaAppletContext.java:125)
> at netscape.applet.MozillaAppletContext.showDocument(MozillaAppletContext.java:117)
> at GoHomeButton.action(GoHomeButton.java:25)
> at java.awt.Component.handleEvent(Component.java:886)
> at java.awt.Component.postEvent(Component.java:832)
> at java.awt.Component.postEvent(Component.java:838)
> at sun.awt.motif.MButtonPeer.action(MButtonPeer.java:39)
> at java.lang.Thread.run(Thread.java:286)
>
> Unfortunately, I don't have access to the MozillaAppletContext.java file
> (does anyone know where I can find that?).
>
> I thought that perhaps the applet was not being destroyed properly
> since the page was changing in GoHomeButton.action() so I tried
> to put the showDocument() call in GoHomeButton.destroy(), but I got
> pretty much the same behavior (slightly different stack trace, of course).
>
> The following is the applet code:
>
> ----------------------------------------------------
> import java.awt.*;
> import java.io.*;
> import java.applet.*;
> import java.net.*;
>
> public class GoHomeButton extends Applet {
> Panel topPanel;
>
> public void init()
> {
> topPanel = new Panel();
> add("Center", new Button("Go Home"));
> }
>
> public boolean action(Event evt, Object what)
> {
> URL home;
> AppletContext appletContext;
>
> if (what.toString().compareTo("Go Home") == 0)
> {
> appletContext = getAppletContext();
> try {
> home = new URL("http://dundee.hr.att.com/~magda/mylinks.html");
> appletContext.showDocument(home);
>
> } catch (MalformedURLException e) {
> System.out.println("EntityWindow: action(), malformed URL");
> } catch (IOException e) {
> System.out.println("EntityWindow: action(), io exception");
> } catch (Exception e) {
> System.out.println("EntityWindow: action(), other exception: " + e.toString());
> e.printStackTrace();
> }
> }
>
> return true;
> }
>
> }
>
>
> ----------------------------------------------------
>
>
> I would appreciate any insight or help anyone could give me.
>
> Thanks.
>
> Magda Nour
> magda@corona.att.com
> (908) 615-5149
>
> -
> This message was sent to the java-interest mailing list
> Info: send 'help' to java-interest-request@java.sun.com
>
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com