Java applet in Win7/IE (only) ignores dynamic height attribute? - java

I have a 10-year-old applet which has worked nicely on all browsers/platforms prior to Win7/IE. On Win7/IE, 32bit and 64bit, the applet loads but does not size correctly to fill the browser window in the vertical dimension. Horizontal dimension is fine. Firefox, Chrome, Safari are fine on Win7, the glitch is only with Win7/IE. No errors in the Java Console.
I'm using the object/comment/embed html syntax, as:
<object classid="blah" width="100%" height="100%" codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_6_0-win.cab#Version=1,6,0,00">
<param name="code" value="lots.of.packages.then.class">
<param name="codebase" value="/goes/here">
<param name="archive" value="foo.jar">
<param name="type" value="application/x-java-applet;version=1.6">
<param name="scriptable" value="false">
<param name="MAYSCRIPT" value="true">
<comment>
<embed
type="application/x-java-applet;version=1.6"
width="100%"
height="100%"
code="lots.of.packages.then.class"
codebase="/goes/here"
archive="foo.jar"
MAYSCRIPT=true
pluginspage="http://java.sun.com/products/plugin/autodl/jinstall-1_6_0-win.cab">
<noembed>
No support for APPLET!!
</noembed>
</embed>
</comment>
</object>
Note the percentage syntax for the width and height attributes: width="100%" height="100%".
Note that if I set the height attribute explicitly, e.g., height="1000", all's well. Setting it with JavaScript results in the same behavior as the percentage syntax.
Has anyone seen this problem with the vertical dimension on Win7 before? Suggestions much appreciated.
--Mark

Related

Embedded Java Applet not displaying

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.

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

Add Class to Param tag - JavaApplet

I have an applet code like this:
<applet type="applet" codebase="." code="ViewerApplet.class" align="center" width="100%" height="600" archive="icepdf-core.jar, icepdf-viewer.jar, icepdf-applet.jar">
<param name="image" value="my_logo.gif" type="image/gif">
<param name="java_arguments" value="-Xmx128m" />
<param name="classloader_cache" value="true" />
<param name="url" value="<%=test%>" />
</applet>
I want to add style to this line. <param name="image" value="my_logo.gif" type="image/gif">
It means, before loading the pdf i have replaced the java logo with my logo.
The logo should be aligned at center with some style. Is it possible to add style to the
above param tag.
Thanks -
Haan
No, the param tags are only for sending parameters to the applet. Definition on w3c:
The 'param' tag is used to define parameters or variables for an object or applet element.
Imagine that the param tag is the same as sending a string to a function, you can't format the string by sending it in a different way.

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