Author Topic: setting up java applet?  (Read 2839 times)

0 Members and 1 Guest are viewing this topic.

Offline Snake X

  • Ancient Veteran
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 810
  • Rating: +33/-8
    • View Profile
setting up java applet?
« on: March 08, 2011, 09:19:45 pm »
??? has anyone ever set up a java applet successfully before? I need help. I have my html file for the applet hosted here: http://greyshadowencodes.webs.com/car.html

and I HAVE the applet (IT IS a .class file, trust me it is I know it has to be .class and compiled which it is) in the same root directory as the car.html file (the page where the applet should be running) and it gives me an error which I don't get. Can anyone help me?

I'll even upload my .java file and you can view source of my link i posted if you need to.
« Last Edit: March 08, 2011, 09:20:28 pm by Snake X »
Loved this place, still the best producers of power metal, and sparked my dreams of coding.

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: setting up java applet?
« Reply #1 on: March 08, 2011, 09:27:03 pm »
Try this
Code: [Select]
<applet
     codebase = "."
     code = "car.class"
     name = "Car"
     width = "600"
     height = "600"
     hspace = "0"
     vspace = "0"
     align = "middle"

>

</applet>

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

Offline Snake X

  • Ancient Veteran
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 810
  • Rating: +33/-8
    • View Profile
Re: setting up java applet?
« Reply #2 on: March 08, 2011, 09:28:58 pm »
:( no that didn't work either. umm ill try lowercase 'car' under name

edit: :( still didn't work. you can just refresh the page if you wanna see

edit edit: I am working in a webs account if that helps
« Last Edit: March 08, 2011, 09:41:12 pm by Snake X »
Loved this place, still the best producers of power metal, and sparked my dreams of coding.

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: setting up java applet?
« Reply #3 on: March 08, 2011, 10:23:32 pm »
It's not your html at all.  You need to read up more on how to do applets.  I suggest you look at this.  I also like compiling into .jar even if it is one class.  It keeps things all neat and tidy to me.  Add this to your code: (It's just another method like paint.  It initializes the app.  It also might be good to call super.paint(g) just in case the super class needs to paint something.  This is because the paint method goes all the way back to java.awt.Container.  It is explained fairly well here.

Code: [Select]
    public void init() {
        super.init();
    }

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: setting up java applet?
« Reply #4 on: March 11, 2011, 01:06:48 pm »
Code: [Select]
<p align="center">
<applet code="MainClass.class" width="640" height="640" alt="Applet GUIDemo demonstrates some basic GUI components">
<div align="center">
<p>
<b>Java is not enabled in your browser</b>
</applet></p>
1. I know this code is XHTML wrong, but I don't use XHTML;
2. The problem is probably the class file;
3. This works great for me (with functional applets classes) so try it too.