[3176] in java-interest

home help back first fref pref prev next nref lref last post

HelloWorldApplet Not Working, more...

daemon@ATHENA.MIT.EDU (Jeremy Cowgar)
Thu Nov 2 12:15:49 1995

From: Jeremy Cowgar <jeremyc@prgone.com>
To: "'Java Intrest Mail List'" <java-interest@java.sun.com>
Date: Thu, 2 Nov 1995 09:26:19 -0500

Previously on the list, someone has told me that it is not working due =
to my HTML file needing a <applet> tag, not simply an <app> tag. This =
was corrected. Here is my new HTML file,

[------------------------------------------------------------------]
<HTML>

<HEAD><TITLE>Java Enhanced</TITLE></HEAD>

<HTML>

<HR NOSHADE>

<applet code=3D"HelloWorldApplet.class" width=3D50 height=3D50>
</applet>

<HR NOSHADE>
</BODY>
</HTML>
[------------------------------------------------------------------]

The source code is as follows:

[------------------------------------------------------------------]
import java.applet.*;
import java.awt.*;

public class HelloWorldApplet extends Applet {
        public void init() {
                resize(150,25);
        }

        public void paint(Graphics g) {
                g.drawString("Hello World", 50, 25);
        }
}
[------------------------------------------------------------------]

In HotJava, I simply get a red box, in Netscape nothing appears (except =
for the <HR>'s of course) and in AppletViewier, I get the following =
message at the dos prompt.

[------------------------------------------------------------------]
C:\PROGRAM\Java\Learning\Applets\ > appletviewer helloworldapplet.html
[no properties loaded, using defaults]
pstatus: load: HelloWorldApplet is not public or has no public =
constructor
load: HelloWorldApplet is not public or has no public constructor
java.lang.IllegalAccessException: HelloWorldApplet
        at sun.applet.AppletPanel.run(AppletPanel.java:232)
        at java.lang.Thread.run(Thread.java:286)
status: exception: java.lang.NullPointerException: null
java.lang.NullPointerException
        at sun.applet.AppletPanel.run(AppletPanel.java:261)
        at java.lang.Thread.run(Thread.java:286)pstatus: init: applet =
not loadedpstatus: start: applet not initialized
status: stop: applet not started
status: destroy: applet not stopped
status: dispose: applet not destroyed
C:\PROGRAM\Java\Learning\Applets\ >
[------------------------------------------------------------------]

Can someone please help me out? The .java file compiles with no errors =
or warnings, and I can run other demos, \program\java\demo\* ...=20

(~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~)=20
(                Jeremy Cowgar - jeremyc@prgone.com                )=20
(------------------------------------------------------------------)
(        Pick Of The Week - http://www.prgone.com/favorite/        )
(     The WWW Hall Of Fame - http://www.prgone.com/HallOfFame/     )=20
( Radio ONE - http://www.prgone.com/RadioOne - radioone@prgone.com )=20
(=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D)
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post