Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2007

Tip: Looking for answers? Try searching our database.

Java Applet not working in web browser

Thread view: 
Cyron - 04 Oct 2007 21:11 GMT
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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.