Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


[java] Applet loading question


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 vtRequiem   Members   -  Reputation: 122

Like
Likes
Like

Posted 24 May 2000 - 10:48 AM

I''m working on a tetris Java applet, and my first little applet to get things rolling is a simple panel that has a block drop. I coded this up in JBuilder 3.5 Foundation. After compilation and all that good stuff, I ran it and it works. The problem now is trying to get it to load on a webpage. I put together a little .html file, but the applet won''t load when I try to view the file with Netscape. That same file works when I use appletviewer in my dos prompt, so that confuses me even more. Also, I''ve looked at other people''s websites with their applets, and copied their code over, and it still didn''t work! I do have the class and the html file in the same folder, too. I''ll post a link to my html file, I figure there must be something butt simple that I''m missing, but this has stumped me for a few hours now. http://derekdaz.homepage.com/applet.html also, you can view my code at http://derekdaz.homepage.com/Double.java Req dddDDDdddDDDdddDDDdddDDDddd Big Brother is Watching

Sponsor:

#2 vtRequiem   Members   -  Reputation: 122

Like
Likes
Like

Posted 24 May 2000 - 10:50 AM

One more thing, on the Java console it says this when I try to load up the page:

java.lang.ClassFormatError: Class already loaded

at java.lang.ClassLoader.defineClass(Compiled Code)

at netscape.applet.AppletClassLoader.loadClass(Compiled Code)

at netscape.applet.AppletClassLoader.findClass(Compiled Code)

at netscape.applet.AppletClassLoader.loadClass1(Compiled Code)

* at netscape.applet.AppletClassLoader.loadClass(Compiled Code)

at netscape.applet.AppletClassLoader.loadClass(Compiled Code)

at netscape.applet.DerivedAppletFrame$LoadAppletEvent.dispatch(Compiled Code)

at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled Code)

at java.awt.EventDispatchThread.run(Compiled Code)

at netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled Code)



Req

#3 felonius   Members   -  Reputation: 122

Like
Likes
Like

Posted 24 May 2000 - 11:24 AM

Hi,

I once had the exact same problem has you have and I were baffled for a whole day. I looked at your code and the reason is the same:

1. You have been using Java 1.2. Netscape and Internet Explorer only supports Java 1.1 - even in the newest versions.
2. You are using Swing. Netscape and Internet explorer do not support Swing.

The appletviewer does not have these problems which is why it works here.

You now have several alternate ways of solving the problem:
1. Rewrite your program in Java 1.1 without Swing.
2. Rewrite your program to Java 1.1 with Swing (now in package com.sun.swing.* as far as I remember) and include the file swing.jar fra the swing kit for Java 1.1 as an archive for your project. This works but the jar file is almost 2MB large which makes it a big download for an applet.
3. Require that the user installs the Sun Java 1.2 plug-in from their site and then change your html page using the free Sun html-converter so the html directs the browser to use the plug-in. The drawback is that the plug-in does not exist on all platforms so you loose plarform portability.

I usually go for solution 1, as this is what makes it easiest for the user.

Jacob Marner

#4 dog135   Members   -  Reputation: 122

Like
Likes
Like

Posted 24 May 2000 - 11:50 AM

IE and Netscape only support Java 1.1!? What the...! What gives with that?

E:cb woof!

#5 vtRequiem   Members   -  Reputation: 122

Like
Likes
Like

Posted 24 May 2000 - 02:14 PM

Jacob!

You''re a life saver! Thanks a lot. I had originally started off with the java plugin requirement, but I think that the code I used for that was buggy or something.

Again, thanks! If I had some cookies, I''d give them to ya!

Take care
Req

dddDDDdddDDDdddDDDdddDDDddd

Big Brother is Watching

#6 felonius   Members   -  Reputation: 122

Like
Likes
Like

Posted 24 May 2000 - 10:37 PM

You are welcome.

By the way. I do not think that it is surprise that the browsers do not support Java 1.2 (or 1.3!).

First Internet Explorer is made by Microsoft and we know how Microsoft feels about Sun. Why should they support Java more than half-hearted. If people see that java gives problems they will stop using Java, not internet explorer. Microsoft wins the dirty way.

Second Netscape has not come with any releases for quite some time. Java 1.1 was supported from Netscape 4.5 and the current full version is 4.72. A prerelease of netscape 6 has just come and it might be that it supports a newer java version.

Jacob Marner




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS