• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Applets fail to load in a browser

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I'm new to creating applets and making them web-accessible, so I was wondering if anyone could help me out with a problem that I keep running into.
When I create an applet (I'm using BlueJ) and then test it, it works just fine. But the thing is I want it to be run off a web site, so I created an HTML page and a simple Applet just to test things out.
This is my applet:


And this is my HTML page:

When I run the html on my old computer, it works just fine. Everything loads properly and it shows up like it should.
But when I use my newer computer, it opens up a web page and shows the title, but where the applet is supposed to be, it just shows a blank box with an X in the corner, and at the bottom bar of firefox it says "applet failed to load..." or something like that.
When I open the java console there are no errors either.
Has anyone else had this problem? And how do I fix it? I need to know to continue with my project.
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like your code is fine.
Did you check if your browser has Java plugin installed correctly ?
 
Xavi Villalta
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah. I'm running Firefox 3.6.8 on OS X 10.5.8.
Latest java updates and everything. I can even view applets that are on tutorial websites.
 
Greenhorn
Posts: 11
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am also facing the same problem with Firefox. Applets work fine in IE but not on Firefox.
 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This has nothing to do with the problem, but be aware that overriding paint in Swing code is almost always the wrong thing to do - the code should override paintComponent instead. See http://download.oracle.com/javase/tutorial/uiswing/painting/closer.html for the rationale.
 
Xavi Villalta
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the info.
As of right now it works on my old computer, but I'll have to test it out on the new one...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic