I tried to run my applet, but it fails to load it, and I get this error in the java consol…
java.lang.NoClassDefFoundError: SecretsOfCelebrindal (wrong name: SecretsofCelebrindal)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
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)
here is my game code…
import javax.swing.*;
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.lang.*;
public class SecretsofCelebrindal extends JApplet implements KeyListener,Runnable {
//-----------------------------------------
//Variables
//-----------------------------------------
int app_width,app_height,tiles_x,tiles_y,map_x,map_y;
Image buffer,map;
Graphics bgraphics;
public Thread th;
//-----------------------------------------
//-----------------------------------------
//initialization
//-----------------------------------------
public void init() {
//do variable stuff
app_width = this.getSize().width;
app_height = this.getSize().height;
tiles_x = 25;
tiles_y = 24;
map_x = 0;
map_y = 0;
}
public void start() {
th = new Thread(this);
th.start();
if(map == null){
map = createImage(app_width,app_height);
}
}
//------------------------------------------
//Controles
//------------------------------------------
public void keyPressed(KeyEvent e){
//Check the controles for gameplay related.
}
public void keyReleased(KeyEvent e){
//check when the user stops running, or walking.
}
public void keyTyped(KeyEvent e){
//For chat and other input with text.
}
//-----------------------------------------
//game loop
//-----------------------------------------
public void run(){
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
while(true){
repaint();
try{
th.sleep(20);
} catch(InterruptedException ex){
}
}
//Thread.currentThread().setPriority(Thread.MAX_PRIORITY);;
}
//-----------------------------------------
//drawing the screen
//------------------------------------------
public void update(Graphics g){
//create buffer
if(buffer == null){
buffer = createImage(app_width,app_height);
bgraphics = buffer.getGraphics();
}
}
public void paint(Graphics g){
g.drawString("This is SecretsofCelebrindal Applet!",100,100);
}
//------------------------------------------
//ending
//------------------------------------------
public void stop(){
}
public void destroy() {
}
}