Add Class to Param tag - JavaApplet - java

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.

Related

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.

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

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

read content from flash and save it on to server an Image using java,jsp

i am embedding flash in jsp using following code so as to activate webcam but i want to read an Image from that object tag using java,jsp or jscript and want save it on to server directory
HOw can we do this?
<object id="whatever" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="282" height="180"codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0">
<param name="src" value="./swf/capturecam.swf"/>
<param name="bgcolor" value="#FFFFFF"/>
<param name="quality" value="best"/>
<embed name="whatever" src="./swf/capturecam.swf" width="282" height="180" bgcolor="#FFFFFF" quality="best" pluginspage="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</embed>
</object>

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