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
staff
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.
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
staff
OK, so there's just a little problem with your HTML file: you're using "CheckerboardPatterns.class" where you should just be using "CheckerboardPatterns" .
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:
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
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.
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?