Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applets fail to load in a browser

 
Xavi Villalta
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • 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.
 
Aparna Sree
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Supradeep Makam
Greenhorn
Posts: 11
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am also facing the same problem with Firefox. Applets work fine in IE but not on Firefox.
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • 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
  • 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...
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic