[3819] in java-interest
[Fwd: Infamous "Applet not initialized", but it's the code this time.]
daemon@ATHENA.MIT.EDU (John D. Kane)
Tue Nov 28 23:12:00 1995
Date: Tue, 28 Nov 1995 21:08:03 -0500
From: "John D. Kane" <john@insightnews.com>
To: java-interest@java.sun.com
Path: news.worldlinx.com!news
From: "John D. Kane" <john@insightnews.com>
Newsgroups: comp.lang.java
Subject: Infamous "Applet not initialized", but it's the code this time.
Date: Mon, 27 Nov 1995 19:19:57 -0500
Organization: INSIGHT New Media Publishing
Lines: 58
Message-ID: <30BA55AD.99D@insightnews.com>
NNTP-Posting-Host: 204.101.142.10
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.0b2 (Windows; I; 32bit)
I'm in the process of creating simple applets and running them to
get a feel for the java language, as I'm just starting out. I wrote
the following simple piece of code to display a string both when the
creation method and when the finalize method go off. I know my
CLASSPATH is set correctly because I can run other applets. I also
have the .HTML, .JAVA, and .CLASS files in the same directory, as I
have done with the other applets that run. Can anyone see anything
funny about this piece of code? I can't, and it's sure not for lack
of trying. (I'm viewing applets with Netscape and creating them in
Windows NT notepad).
//The name of this file is OrderExec1Pgm.java
import java.applet.Applet;
import java.awt.*;
class OrderExec1 extends java.applet.Applet {
Graphics g = getGraphics();
int aNum;
public OrderExec1(int anInt) {
aNum = anInt;
g.drawString("\nCalling Creation Method", 10, 10);
}
public void finalize() {
g.drawString("\nCalling Finalize Method", 10, 20);
aNum = 0;
}
}
public class OrderExec1Pgm {
public static void main(String args[]) {
OrderExec1 oe1= new OrderExec1(5);
}
}
Just in case, here's the HTML file used to load the applet. It's
name is OrderExec1Pgm.html
<html>
<title>OrderExec1Pgm.html</title>
<body>
<hr>
<applet code="OrderExec1Pgm" width=500 height=100>
</applet>
<hr>
</body>
</html>
By the way, has anyone got the JDB debugger up and running without
HotJava? If so, where could I find some good examples on using it?
I'm working in Windows NT environment.
Any help would be much appreciated.
John
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com