Java Applet not working in web browser

C

Cyron

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
 
A

Andrew Thompson

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.
 
R

Roedy Green

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top