Forums Register Login

Applet notinited

+Pie Number of slices to send: Send
I am trying to create an applet, but at the bottom of the screen (in the status bar) it says "Applet CheckerboardPatterns notinited". I am using some examples from my textbook, but I still cannot see what I am doing wrong. Any help is appreciated.

+Pie Number of slices to send: Send
Hi,

Welcome to JavaRanch!

You can generally get more information about what went wrong by looking at the Java Console. Details of how to get to this vary depending on your OS and browser.

Just looking at the code, I see that it would require Java 1.5; perhaps you've got a Java 1.4 or earlier plugin in your browser. But that's just a guess; the Java Console would tell you for sure.
+Pie Number of slices to send: Send
Thanks for the reply. Here is what the Java Console shows:

Java Plug-in 1.6.0
Using JRE version 1.6.0 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Joe
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
load: class CheckerboardPatterns.class not found.
java.lang.ClassNotFoundException: CheckerboardPatterns.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: C:\CheckerboardPatterns\class.class (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more
+Pie Number of slices to send: Send
OK, so there's just a little problem with your HTML file: you're using "CheckerboardPatterns.class" where you should just be using "CheckerboardPatterns" .
+Pie Number of slices to send: Send
In the examples that I am using, it has "Classname.class" in the html file.

I have gone in and changed the path and classpath and now the examples that were working before are not working now. Here is what my Environment Variables look like:

End User Variables:

CLASSPATH
.;C:\java

PATH
C:\Program Files\Java\jdk1.6.0\bin;C:\java


System Variables:

CLASSPATH
.;C:\Program Files\Java\jre1.6.0\lib\ext\QTJava.zip;C:\java

Path
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;c:\Program Files\Microsoft SQL Server\90\Tools\binn\


Any help is appreciated.
+Pie Number of slices to send: Send
OK, I have fixed my path and class path. Here�s what they are set to:
Environment Variables
User Variables
CLASSPATH=.;C:\Program Files\Java\jre1.6.0\bin;C:\java
PATH=C:\Program Files\Java\jdk1.6.0\bin

System Variables
CLASSPATH=.;C:\Program Files\Java\jre1.6.0\lib\ext\QTJava.zip
Path=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Java\jdk1.6.0\bin



At http://java.sun.com/developer/onlineTraining/new2java/ it shows an html file with the .class at the end:



I took the .class out of my html file and I am still getting this in the Java Console:

Java Plug-in 1.6.0
Using JRE version 1.6.0 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Joe
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
load: class CheckerboardPatterns not found.
java.lang.ClassNotFoundException: CheckerboardPatterns
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: C:\CheckerboardPatterns.class (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more



I cannot figure out why I'm still getting the Applet CheckerboardPatterns notinited.
+Pie Number of slices to send: Send
Is the class CheckerboardPatterns located in the same directory as the HTML file (and class SimpleApplet)?
+Pie Number of slices to send: Send
Yes, class CheckerboardPatterns is located in the same directory as the HTML file. What is class SimpleApplet?

I have rewritten the program and I am having some problems with using enums, strings, and ints together in my paintDiagonals method. Am I using the right approach to number the squares diagonally moving up from left to right?

+Pie Number of slices to send: Send
Are you trying to load it through a browser? Have you tried appletviewer?
This looks like a job for .... legal tender! It says so right in this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1795 times.
Similar Threads
Painting shells
Have a chess board, need help assigning values so GUI can update
nokia 6600 can't select button.......
nokia 6600 can't select button.......
To Thread
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:40:39.