Embedded Java Applet not displaying - java

Attempting to embed a Java applet to an existing webpage. Code appears to be correct (at least as far as I understand it). However in FireFox, the applet simply doesn't show and in IE, I get a couple of different messages stating Java content has been restricted. Yes, Java is enabled in both browsers. My research suggests that the problem may be the web browsers simply blocking Java outright, due to the recent security concerns, however I really would like to double the code to make sure nothing is wrong with it.
Am I missing something with my code or is this the browsers refusing to display Java over security concerns?
Any thoughts?
<div id="links">
<!--[if IE]><!-->
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
codebase="http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab"
type="application/x-java-applet"
width="700" height="30">
<param name="code" value="PopMenu.class" />
<!--<![endif]-->
<!--[if !IE]><!-->
<object classid="java:PopMenu.class"
type="application/x-java-applet"
width="700" height="30">
<!--<![endif]-->
<param name=labelpos value="right" />
<param name="src0" value="button0.gif" />
<param name="src1" value="button1.gif" />
<param name="src2" value="button2.gif" />
<param name="src3" value="button3.gif" />
<param name="text0" value="Robert Frost on Wikipedia"/>
<param name="text1" value="Robert Frost at Poets.org"/>
<param name="text2" value="Robert Frost Out Loud"/>
<param name="text3" value="Robert Frost: America's Poet"/>
<param name="href0" value="http://en.wikipedia.org/wiki/Robert_Frost"/>
<param name="href1" value="http://www.poets.org/poet.php/prmPID/192"/>
<param name="href2" value="http://robertfrostoutloud.com"/>
<param name="href3" value="http://www.ketzle.com/frost"/>
</object>
</div>
EDIT
In response to the comments below; this is part of a school assignment and I have no code for the applet to post; only the .class file. It appears that I'm not the only one in class trying to figure out this issue; however the professor's only response is to write the code as the textbook teaches it. I've done that; but I still want to make sure I'm not missing something, hence why I'm asking about here.

Related

Applet Java not working on IE9 but fine on Firefox

i'm stuck with a little problem, i develop a java applet under windows 7 with JRE 1.6_0.37 and all work fine on IE9 and FF.
When we decide to test the application in target environment with a vmware pre-configured with client installation (IE9 and JRE1.6_0.20) we see that applet are not working ( i have a message like : Error : click here to have mmore informations on the top left corner of the page). When i check java console, i can see classnotfound. I try to download the jar directly (like http://myhost/applet/my.jar) and it work.
I decide to test with firefox and all work fine. But the target is IE9 :(
I check all parameter under IE to see if plugin are ok and activate and all seems to be ok.
why Firefox can retrieve JAR without problem and IE not?
i'm really stuck so if you can help me ;)
applet code:
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="100%" height="600" name="applet_appletObject" id="applet_appletObject">
<param name="code" value="fr.edf.mpv2.castor.applet.client.CastorAppletGraphique.class">
<param name="name" value="applet_appletObject/">
<param name="codebase" value="applet_appletObject/">
<param name="boxbgcolor" value="white">
<param name="scriptable" value="true">
<param name="java_arguments" value="-Xmx512m -Xms96m">
<param name="mayscript" value="true">
<param name="codebase_lookup" value="false">
<param name="archive" value="/ctrweb/applet/castor-applet-client-02.00.00.jar,/ctrweb/applet/castor-applet-commun-02.00.00.jar,/ctrweb/applet/commons-logging-1.0.4.jar,/ctrweb/applet/jcommon-1.0.13.jar,/ctrweb/applet/jfreechart-1.0.10.jar,/ctrweb/applet/jcalendar-1.3.3.jar">
<param name="cache_archive" value="/ctrweb/applet/castor-applet-client-02.00.00.jar,/ctrweb/applet/castor-applet-commun-02.00.00.jar,/ctrweb/applet/commons-logging-1.0.4.jar,/ctrweb/applet/jcommon-1.0.13.jar,/ctrweb/applet/jfreechart-1.0.10.jar,/ctrweb/applet/jcalendar-1.3.3.jar">
<param name="cache_version" value="02.00.00, 02.00.00, 1.0.4.0, 1.0.D.0, 1.0.A.0"> <param name="appletName" value="applet_appletObject"/>
<param name="resolutionY" value="1024"/>
<param name="locale" value="fr"/>
</object>
thanks a lot
That's why IE doesn't have any friend, as user1071777 saysm some code and a screenshot will be usefull, but, have you tried to check it on other environment rather than VM, some members of my team can't start applets and/or javascripts from VM... maybe because they are made of tweaked OS versions

Why are security settings blocking this java applet?

So I am trying to have a scrolling ticker like the news has and I found an applet but there are two problems.
1. Security settings are blocking it
2. I don't understand how the codebase works to look at the java source code.
If anyone can point me in the right direction it would be appreciated.
<APPLET NAME="Ticker1"
CODE="Ticker.class"
ARCHIVE="Ticker.jar"
CODEBASE="http://java.barchart.com/ticker"
HEIGHT="40"
WIDTH="450"
>
<PARAM NAME="panels" VALUE="1">
<PARAM NAME="1:symbols" VALUE="'Indices,$NASX:Nasdaq Comp,'Stocks,IBM,GE,EBAY,YHOO:Yahoo!">
<PARAM NAME="1:scroll" VALUE="-1, 50">
<PARAM NAME="1:bgcolor" VALUE="#000000">
<PARAM NAME="1:fgcolor" VALUE="#FFFFFF">
<PARAM NAME="1:pscolor" VALUE="#00CC00">
<PARAM NAME="1:ngcolor" VALUE="#FF3333">
<PARAM NAME="1:hilight" VALUE="#FFFF00">
<PARAM NAME="1:font" VALUE="Arial, Bold, 12">
<PARAM NAME="1:multiline" VALUE="true">
</APPLET>
Here is the webmaster tool http://www.insidestocks.com/ticker.asp

Force applet to load only once

Here's my situation:
I need to keep an applet loaded, and avoid having to reload it each time the user goes to the page where the applet is embedded.
How can i achieve this? Are there any parameters to set my applet to be singleton?
Here are the parameters I'm currently using:
<object id="mockapplet" name="mockapplet"
classid="java:mockClass"
type="application/x-java-applet"
archive="#{myAppletPath}"
height="1"
width="1" codebase=".">
<param name="code" value="mockApplet" />
<param NAME="MAYSCRIPT" VALUE="true" />
<param name="archive" value="#archivePath}" />
<param name="JAVA_CODEBASE" value="." />
<font color="red">Applet error</font>
</object>
in fact i need init() method to be call only once , in my case it is call each time my page reloads.
well, if your applet is Embedded in your page, you reload it each time you reload the page ! if you want to keep parameters, you have to set a cookie.

How to cache a java applet?

can anyone explain to me how to cache a java applet, to speed up performance when reloading the same applet on another page or return.
You need to specify parameters within the applet's HTML object or embed tag:
http://download.oracle.com/javase/1.4.2/docs/guide/plugin/developer_guide/applet_caching.html
Does this page answer it?
<OBJECT ....>
<PARAM NAME="archive" VALUE="...">
....
<PARAM NAME="cache_option" VALUE="...">
<PARAM NAME="cache_archive" VALUE="...">
<PARAM NAME="cache_version" VALUE="...">
</OBJECT>
or
<EMBED ....
archive="..."
....
cache_option="..."
cache_archive="..."
cache_version="...">

Applet to Object tags

im trying to get from applet to object so i can resolve z-index issues. The first applet tag works...my conversion to object doesn't. Can anyone point me in the right direction?
From:
<applet name='previewersGraph' codebase="http://www.mydomain.info/sub/" archive="TMApplets.jar" code='info.tm.web.applet.PreviewerStatsGraphApplet' width='446' height='291'>
<param name="background-color" value="#ffffff" />
<param name="border-color" value="#8c8cad" />
To:
<OBJECT id="previewersGraph" name="previewersGraph" classid="clsid:CAFEEFAC-0014-0002-0000-ABCDEFFEDCBA"
width="200" height="200" align="baseline"
codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#Version=1,4,2,0">
<PARAM name="code" value="info.tm.web.applet.PreviewerStatsGraphApplet">
<PARAM name="codebase" value="http://www.mydomain.info/sub/">
<PARAM name="type" value="application/x-java-applet;jpi-version=1.4.2">
<PARAM name="archive" value="TMApplets.jar">
<PARAM name="scriptable" value="true">
No Java 2 SDK, Standard Edition v 1.4.2 support for APPLET!!
</OBJECT>
Firefox fails with a classid attribute. The below should work cross browser:-
<p>
<object type="application/x-java-applet"
name="previewersGraph" width="446" height="291">
<param name="codebase" value="http://www.mydomain.info/sub/" />
<param name="code" value="info.tm.web.applet.PreviewerStatsGraphApplet" />
<param name="archive" value="TMApplets.jar" />
<param name="scriptable" value="true" />
<param name="mayscript" value="true" />
<param name="background-color" value="#ffffff" />
<param name="border-color" value="#8c8cad" />
</object>
</p>
In my tests both IE8 and FF5 required the "type" attribute. The mayscript param is only required for Java plugins before 1.6.0.10. The scriptable param is still required according to javadocs 1.6.0.21. In a test with 1.6.0.24 for a signed applet, IE8 called it OK from JS without scriptable being set true.
The HtmlConverter tool in the jdk/bin directory should help you to create the Object tag (at least with an old version of Java).
Now Sun (euh Oracle) recommends the applet tag and even jnlp. Look at the deployJava.js script.
I don't think changing it to object will fixed your problem as the applet will be still be paint above the HTML.
Why you do not use deployment toolkit ? It would save you a lot of trying - see http://rostislav-matl.blogspot.com/2011/10/java-applets-building-with-maven.html for more info.

Categories