[5917] in java-interest

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

RE: Stupid Newbie Questions

daemon@ATHENA.MIT.EDU (Groshe)
Mon Mar 4 21:20:54 1996

From: Groshe <gnicaj@iu.net>
To: "java-interest@java.sun.com" <java-interest@java.sun.com>,
        "'Robert Stober'" <rstober@landrush.com>
Date: Mon, 4 Mar 1996 19:14:10 -0500

You need to precede class HelloWorldApplet extends java.applet.Applet by the keyword public

i.e public class HelloWorldApplet extends java.applet.Applet 

----------
From: 	Robert Stober[SMTP:rstober@landrush.com]
Sent: 	Sunday, March 03, 1996 10:48 AM
To: 	java-interest@java.sun.com
Cc: 	rstober@landrush.com
Subject: 	Stupid Newbie Questions

Hi all,

I'm new to Java and am trying make this rediculously simple script run.
I've tried to run it using Netscape 2.0 and the below HTML code, but all I
get is "My java Applet says:". I also tried to run it using the
Appletviewer and all I get the is "No Applets Running" message at the
bottom, even when I start the Appletviewer application by dropping the HTML
file (below) right on the icon.

BTW- I'm using the Mac Java version 1.0b to compile. The script below which
is supposed to display "Hello world!" below the header "My java Applet
says:".As far as I know, the script below should work, and the HTML which
calls the compiled "HelloWorldApplet.class" should also work.

Anybody got any suggestions of what could be causing my problem (I believe
it's called operator ignorance)....

Thanks in advance for your input:->

________________________________________________________________________________

import java.awt.Graphics;

class HelloWorldApplet extends java.applet.Applet {

                public void paint(Graphics g) {
                                g.drawString("Hello world!", 5, 25);
                }
}
________________________________________________________________________________

<HTML>
<HEAD>
<TITLE>Hello to Everyone!</TITLE>
</HEAD>
<BODY>
<H2>My java Applet says:</H2>
<APPLET CODE="HelloWorldApplet.class" WIDTH=150 HEIGHT=25></APPLET>
</BODY>
</HTML>

________________________________________________________________________________

Another BTW: Do I need the </APPLET> tag?

_______________ Landrush - Interactive Marketing Solutions ______________

Robert Stober                                         (352) 319-4779 Pager
WEB: http://www.landrush.com/                         (352) 357-4174 Office
EMAIL: rstober@landrush.com                           (352) 357-1904 Fax

__________ Searchable Database of Florida Real Estate Listings __________



-
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

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