Hello,
I've developed a simple Java Applet using Eclipse -- it works just
fine from within Eclipse, but I can't get it to render from within a
web browser. I have copied the following files into a folder:
index.html // the webpage i'm trying to view the applet from
CheckIt.class // the applet file produced by Eclipse
java.policy.applet // another file that came with the .class file.
The contents of my index.html:
<html>
<body>
<APPLET CODE="CheckIt.class" WIDTH=900 HEIGHT=900 />
</body>
</html>
When I launch index.html (this is all done locally), the page appears
as if the Applet wants to load, but nothing happens -- I'm just left
with a gray region according to the width and height dimensions I
specify in index.html
The web browser will successfully load other applets from the web, so
I know that it is configured properly -- for some reason it doesn't
like mine (which is magnitudes simpler than the ones I view on the
web). Any clues as to what is wrong?
Thanks,
Mike
Andrew Thompson - 05 Oct 2007 04:15 GMT
...
> I've developed a simple Java Applet ..
There is no such thing. The only simple projects
run headless (no GUI), and applets embedded in a web
page add a whole new (and exciting) level of problems.
Having experience with both applets, and separately
frames (and applets) launched using web start* (from
a browser link), I would recommend web start and frame.
I there any reason this little project needs a
browser wrapped around it?
>..using Eclipse -- it works just
> fine from within Eclipse, ..
How doe eclipse run the applet? Does in invoke
the JDK's AppletViewer?
>..but I can't get it to render from within a
> web browser.
Do you pop your browser's console?
>.. I have copied the following files into a folder:
>
> index.html // the webpage i'm trying to view the applet from
> CheckIt.class // the applet file produced by Eclipse
> java.policy.applet // another file that came with the .class file.
Are you AKA 'Willy Stevens'?! That is the second
reference to policy files in regard to applets that
I've heard today!
...
* For some examples of apps. launched using
web start, see <http://www.physci.org/jws/#apps>
Andrew T.
Roedy Green - 05 Oct 2007 06:57 GMT
>The web browser will successfully load other applets from the web, so
>I know that it is configured properly -- for some reason it doesn't
>like mine (which is magnitudes simpler than the ones I view on the
>web). Any clues as to what is wrong?
follow the recipe at http://mindprod.com/jgloss/applet.html
If that does not work, turn on the Java console. The error message
will give us a much better clue what the problem is.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Roedy Green - 05 Oct 2007 08:42 GMT
> <APPLET CODE="CheckIt.class" WIDTH=900 HEIGHT=900 />
see http://mindprod.com/jgloss/applet.html
for deployment, always put your applet in a package and jar.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com