i created a game in applet and i want to put it on a site. the problem is that my games has alot of classes. how can i use applet tag to up it online?

java.php

 <html>
   ...
       <applet code = "Main.class" width = 900 height = 400> </applet>    
   ...
   </html>

my folder tree

-java_game
    -java.php
    -main.class
    -item.class
    -background.clas
    -enemy.class
    -...
    -music
         -...
    -image
        -...

Recommended Answers

All 2 Replies

Please read oracle tag embeded. In your website, you need to structure (folders & file locations) similar to whatever in your development. If your main class is in the same location as your page, you need copy exactly the same folder structure and file location on to your web server location. One thing, you must NOT use absolute path in any of your code or your web page. You must use relative path only or you will have a hard time porting it from development environment to anywhere else.

dc531e72750853ec65370adb2eaafb55
here is my folder where there are all my java classes, images, and sounds. they all in one folder. when i run in web i get this error:

it is kind of working now. erros are gone and i can see the background of my applet. but the problem is that its not moving and i cant see my player, enemy or items. any idea why this is?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.