I am going through
Java Language Basics, downloaded from the Oracle website. I've installed the latest version of NetBeans and Java (6.9.1). On lesson 3, I am given the following instructions:
Application to
Applet
The following code is the applet equivalent to the LessonTwoB application from Lesson 2. The figure below shows how the running applet looks. The structure and elements of the applet code are discussed after the section on how to run the applet just below.
The SimpleApplet class is declared public so the program that runs the applet (a browser or appletviewer), which is not local to the program can access it.
Run the Applet
To see the applet in action, you need an HTML file with the Applet tag as follows:
The easiest way to run the applet is with appletviewer shown below where simpleApplet.html is a file that contains the above HTML code:
appletviewer simpleApplet.html
The java code is in both a text file names SimpleApplet.java and in SimpleApplet.class. (Actually, I tried it both ways.) The html code is as stated. I've set up the path variable to include the bin directory.
When I run the appletviewer, I get the following error messages in the command window, and the applet opens and does nothing.
What am I doing wrong?
Fred