This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Applets and the fly likes Applet notinited Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet notinited" Watch "Applet notinited" New topic
Author

Applet notinited

Eric Kovach
Greenhorn

Joined: Feb 06, 2007
Posts: 5
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.

Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

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.


[Jess in Action][AskingGoodQuestions]
Eric Kovach
Greenhorn

Joined: Feb 06, 2007
Posts: 5
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
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

OK, so there's just a little problem with your HTML file: you're using "CheckerboardPatterns.class" where you should just be using "CheckerboardPatterns" .
Eric Kovach
Greenhorn

Joined: Feb 06, 2007
Posts: 5
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.
Eric Kovach
Greenhorn

Joined: Feb 06, 2007
Posts: 5
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.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41178
    
  45
Is the class CheckerboardPatterns located in the same directory as the HTML file (and class SimpleApplet)?


Ping & DNS - my free Android networking tools app
Eric Kovach
Greenhorn

Joined: Feb 06, 2007
Posts: 5
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?

Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
Are you trying to load it through a browser? Have you tried appletviewer?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet notinited
 
Similar Threads
Knight's tour
nokia 6600 can't select button.......
Painting shells
nokia 6600 can't select button.......
A conundrum with seting Graphics font size