Mkay,
So I’ve been trying to port the Tetris game I made for class into an Applet, so that I could show it to people without them having to download and run the Jar file. But no matter how I try and pack the Jar file and run the applet I keep getting “java.lang.ClassNotFoundException: Game.class” as an error.
The html code I use to try and get it running is:
<applet code="Game.class"
archive="Tetris.jar"
width="120" height="120">
</applet>
(Yeah, very small dimension, but I’ll change that once it’s actually fricking running :/)
And the Manifest.txt for the Jar file is:
Main-Class: Game.class
I’ve also tried naming it just “Game” in both the manifest and the html. Just changes the error to be without .class in the end.
The Game.java file contains:
import javax.swing.JApplet;
import Model.Tetris;
import Model.Tetris6_2;
public class Game extends JApplet {
public void init() {
Tetris ts = new Tetris6_2();
ts.startGame(10, 20);
}
}
The Jar file runs perfectly when the Game.java file is changed to:
import Model.Tetris;
import Model.Tetris6_2;
public class Game {
public static void main(String[] args) {
Tetris ts = new Tetris6_2();
ts.startGame(10, 20);
}
}
Any help with making this stupid Tetris game run as an Applet would be greatly appreciated!