I tried to run my applet, but it fails to load it, and I get this error in the java consol...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| 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...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
| import javax.swing.*; import java.applet.*; import java.awt.*; import java.awt.event.*; import java.lang.*;
public class SecretsofCelebrindal extends JApplet implements KeyListener,Runnable { int app_width,app_height,tiles_x,tiles_y,map_x,map_y; Image buffer,map; Graphics bgraphics; public Thread th; public void init() { 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); } } public void keyPressed(KeyEvent e){ } public void keyReleased(KeyEvent e){ } public void keyTyped(KeyEvent e){ } public void run(){ Thread.currentThread().setPriority(Thread.MAX_PRIORITY); while(true){ repaint(); try{ th.sleep(20); } catch(InterruptedException ex){ } } } public void update(Graphics g){ 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); } public void stop(){ } public void destroy() { } } |