开发者

What does a never ending Java Applet loader signify?

开发者 https://www.devze.com 2023-03-10 06:01 出处:网络
Currently I am trying to embed a Java applet onto a webpage, and the only result I get is the java logo spinning and an empty loading bar.

Currently I am trying to embed a Java applet onto a webpage, and the only result I get is the java logo spinning and an empty loading bar.

example

I can't tell if its an error in my Java code or if I did something wrong with the HTML file.

Here is what I have for HTML.

<applet>
archive="game.jar"
code="BRANDON.GameApplet.class"
width=800
height=600
</applet>

BRANDON is the package I created with the rest of my files and GameApplet is the class which has the applet necessary methods. The game.jar is located in the same location as my HTML file, and the GameApplet class file is located in the jar within the BRANDON folder. The applet runs just fine in eclipse when told to run as an applet so I can't imagine it being a problem with the Java code.

My suspension is that it is a problem with file placement but every variation I try comes up with similar results. Anyone know what the mysterious loader means, and what I am doing to cause it?

Thanks to anyone who might answer.

EDIT: Just enabled the dev开发者_运维技巧eloper console and the only output it gives me is:

APPLET tag missing CODE parameter.

I don't know how much this helps.


Enable the Java Console so you can see the error messages and take appropriate action.


edit: You need it inside the applet tag

<apple code="..." ...>

now it is just some text inside the tag.


My suspicion is that your class files are simply not being found, though I don't have enough info to know for sure. Some thoughts:

  • double-check the file structure inside of game.jar. e.g. GameApplet.class should appear in the BRANDON/GameApplet.class folder relative to the root of your jar file.
  • check that your folder names and class names are correct
  • check that when you jar'd your applet, you didn't forget to include class files. I have jar'd all of my source files before, forgetting to compile them before creating the jar
0

精彩评论

暂无评论...
验证码 换一张
取 消