This site requires JavaScript, please enable it in your browser!
Greenfoot back
Griffon
Griffon wrote ...

2014/9/5

How to make the applet work?

Griffon Griffon

2014/9/5

#
I know when you click on share there is a web page option, and it creates an applet form of the game and a webpage, but when I open up the webpage it gives me an error (yes it is updated and yes I did allow it to run, even put a blocker exception for it, etc.). When that page is validated the webpage (http://validator.w3.org/) it had 2 errors and they were: no doctype declared and that there is no end tag for a font element. When I add a doctype (only change) it has 13 errors for html5 and 17 errors for XHTML 1.0 Strict. For starters the font tag is now obsolete (but that's easy to fix, just remove it). The center tag is also obsolete now (once again I could just remove it). There were a few other errors that could be easily taken care of. ANYWAYS the others mainly come from the fact that the applet tag is obsolete and it suggests I use the object tag instead. I think that is why I get an error on the java applet when I open the html file up. What still gets me is that this website still uses the applet tag when you right click on it and press Inspect element unless it is using an older version of html then what I'm being taught (but I don't think so). Does anyone know how to use the object tag or how to get the applets to work?
davmac davmac

2014/9/5

#
Where is this web page?
Griffon Griffon

2014/9/5

#
You go to share in greenfoot, press the webpage tab then click export. Whatever it's exported to there should be a .html file inside and that's what I was talking about that had all the errors in it.
davmac davmac

2014/9/5

#
Yes, but where did you put this .html file? Have you got it on a web server somewhere or are you just trying to run it locally - because I'm pretty sure Java hasn't allowed local applets for a while. A few minor html issues aren't going to stop an applet from running.
Griffon Griffon

2014/9/6

#
It was just stored locally on my computer. I didn't know that about applets since I never used them before. The collage I'm going to lets me create my own Web page but I was wanting to test if it works before I upload it. Also I don't know if I'd call an obsolete html tag minor though; it said to use the object tag instead.
davmac davmac

2014/9/6

#
Also I don't know if I'd call an obsolete html tag minor though; it said to use the object tag instead.
See for instance http://stackoverflow.com/questions/10076200/applet-vs-object, http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/applet/using_tags.html (which is the official documentation from Oracle), https://www.ailis.de/~k/archives/63-How-to-use-Java-applets-in-modern-browsers.html. I'm pretty sure you can't get Java applets to work using just the "object" tag in many browsers.
matrixmike matrixmike

2016/6/29

#
I enjoyed Applets from a long time ago and am aware that there is some resistance to them these days for what seems to be some unfounded or lazy reasons. I have just (one day) started working with Greenfoot and am quite excited that it exists. I read somewhere, and I'll dig out and have another look, how to run Applets in modern browsers - I saw some excellent guidelines somewhere. I want to see how my test - really just wombatworld - renders via an Applet. I have some old saved environments for just this situation.
You need to login to post a reply.