Very beginner - What's wrong in my applet declaration?
The following code is used into a HTMLl page to call an applet:
HTML Code:
<applet id="PanoAPPLET" archive="ptviewer.jar" code="ptviewer.class" width="480" height="360">
<param name="file" value="ptviewer:0">
<param name="wait" value="foto/wait.png"> <!-- immagine durante il downloading dell'immagine selezionata -->
<param name="view_width" value="480">
<param name="view_height" value="300">
<param name="bar_x" value="40"> <!-- coordinata x iniziale della "progress bar". Fare in modo che (bar_x + bar_width < width) -->
<param name="bar_y" value="280"> <!-- coordinata y iniziale della "progress bar". Fare in modo che (bar_y + bar_height < height) -->
<param name="bar_width" value="400"> <!-- larghezza della "progress bar" -->
<param name="bar_height" value="8"> <!-- altezza della "progress bar" -->
<param name="frame" value="foto/BarraStrumenti.gif">
<param name="barcolor" value="000fff">
<param name="bgcolor" value="ffffff"> <!-- definizione shotspots -->
<param name="shotspot0" value="x15 y305 a50 b355 u'ptviewer:ZoomIn()' ">
<param name="shotspot1" value="x70 y305 a105 b355 u'ptviewer:ZoomOut()' ">
<param name="shotspot2" value="x125 y305 a150 b355 u'ptviewer:startAutoPan(0, 0.2, 1)' ">
<param name="shotspot3" value="x155 y305 a195 b355 u'ptviewer:stopAutoPan()' ">
<param name="shotspot4" value="x200 y305 a220 b355 u'ptviewer:startAutoPan(0, -0.2, 1)' ">
<param name="shotspot5" value="x240 y305 a300 b355 u'ptviewer:moveTo(0,0,90,50)' ">
<param name="shotspot6" value="x325 y305 a365 b355 u'ptviewer:startAutoPan(-0.2, 0, 1)' ">
<param name="shotspot7" value="x375 y305 a415 b355 u'ptviewer:stopAutoPan()' ">
<param name="shotspot8" value="x420 y305 a460 b355 u'ptviewer:startAutoPan(0.2, 0, 1)' ">
<!-- definizione lista immagini panoramiche -->
<param name="pano0" value=" {file=foto/pano0.jpg} {pan=0} {tilt=0} {fov=90} {fovmax=100} {fovmin=80} {auto=0.2} {panmin=-115} {panmax=90} ">
<param name="pano1" value=" {file=foto/pano1.jpg} {pan=0} {tilt=0} {fov=90} {fovmax=100} {fovmin=80} {auto=0.2} ">
<param name="pano2" value=" {file=foto/pano2.jpg} {pan=0} {tilt=0} {fov=90} {fovmax=100} {fovmin=80} {auto=0.2} ">
<param name="pano3" value=" {file=foto/pano3.jpg} {pan=0} {tilt=0} {fov=90} {fovmax=100} {fovmin=80} {auto=0.2} {panmin=-75} {panmax=75} ">
<param name="pano4" value=" {file=foto/pano4.jpg} {pan=0} {tilt=0} {fov=90} {fovmax=100} {fovmin=80} {auto=0.2} {panmin=-95} {panmax=65} ">
<param name="pano5" value=" {file=foto/pano5.jpg} {pan=0} {tilt=0} {fov=90} {fovmax=100} {fovmin=80} {auto=0.2} {panmin=-95} {panmax=65} ">
<param name="pano6" value=" {file=foto/pano6.jpg} {pan=0} {tilt=0} {fov=90} {fovmax=100} {fovmin=80} {auto=0.2} {panmin=-95} {panmax=65} ">
</applet>
When I use Safari browser (4.0.4), the following error report is generated into the Java Console:
java.net.MalformedURLException: no protocol:
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at sun.plugin.liveconnect.SecureInvocation.checkLiveC onnectCaller(Unknown Source)
at sun.plugin.liveconnect.SecureInvocation.access$000 (Unknown Source)
at sun.plugin.liveconnect.SecureInvocation$2.run(Unkn own Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin.liveconnect.SecureInvocation.CallMethod (Unknown Source)
It's important to note that with other browsers (ie: Internet Explorer, Firefox, Chrome) no error is generated.
Can somebody help me? Please consider that I'm a very beginner.
Re: Very beginner - What's wrong in my applet declaration?
Quote:
Originally Posted by
rforte
The following code is used into a HTMLl page to call an applet:
<applet id="PanoAPPLET" archive="ptviewer.jar" code="ptviewer.class" width="480" height="360">
<param name="file" value="ptviewer:0">
<param name="wait" value="foto/wait.png"> <!-- immagine durante il downloading dell'immagine selezionata -->
<param name="view_width" value="480">
<param name="view_height" value="300">
<param name="bar_x" value="40"> <!-- coordinata x iniziale della "progress bar". Fare in modo che (bar_x + bar_width < width) -->
<param name="bar_y" value="280"> <!-- coordinata y iniziale della "progress bar". Fare in modo che (bar_y + bar_height < height) -->
<param name="bar_width" value="400"> <!-- larghezza della "progress bar" -->
<param name="bar_height" value="8"> <!-- altezza della "progress bar" -->
<param name="frame" value="foto/BarraStrumenti.gif">
<param name="barcolor" value="000fff">
<param name="bgcolor" value="ffffff"> <!-- definizione shotspots -->
<param name="shotspot0" value="x15 y305 a50 b355 u'ptviewer:ZoomIn()' ">
<param name="shotspot1" value="x70 y305 a105 b355 u'ptviewer:ZoomOut()' ">
<param name="shotspot2" value="x125 y305 a150 b355 u'ptviewer:startAutoPan(0, 0.2, 1)' ">
<param name="shotspot3" value="x155 y305 a195 b355 u'ptviewer:stopAutoPan()' ">
<param name="shotspot4" value="x200 y305 a220 b355 u'ptviewer:startAutoPan(0, -0.2, 1)' ">
<param name="shotspot5" value="x240 y305 a300 b355 u'ptviewer:moveTo(0,0,90,50)' ">
<param name="shotspot6" value="x325 y305 a365 b355 u'ptviewer:startAutoPan(-0.2, 0, 1)' ">
<param name="shotspot7" value="x375 y305 a415 b355 u'ptviewer:stopAutoPan()' ">
<param name="shotspot8" value="x420 y305 a460 b355 u'ptviewer:startAutoPan(0.2, 0, 1)' ">
<!-- definizione lista immagini panoramiche -->
<param name="pano0" value=" {file=foto/pano0.jpg} {pan=0} {tilt=0} {fov=90} {fovmax=100} {fovmin=80} {auto=0.2} {panmin=-115} {panmax=90} ">
<param name="pano1" value=" {file=foto/pano1.jpg} {pan=0} {tilt=0} {fov=90} {fovmax=100} {fovmin=80} {auto=0.2} ">
<param name="pano2" value=" {file=foto/pano2.jpg} {pan=0} {tilt=0} {fov=90} {fovmax=100} {fovmin=80} {auto=0.2} ">
<param name="pano3" value=" {file=foto/pano3.jpg} {pan=0} {tilt=0} {fov=90} {fovmax=100} {fovmin=80} {auto=0.2} {panmin=-75} {panmax=75} ">
<param name="pano4" value=" {file=foto/pano4.jpg} {pan=0} {tilt=0} {fov=90} {fovmax=100} {fovmin=80} {auto=0.2} {panmin=-95} {panmax=65} ">
<param name="pano5" value=" {file=foto/pano5.jpg} {pan=0} {tilt=0} {fov=90} {fovmax=100} {fovmin=80} {auto=0.2} {panmin=-95} {panmax=65} ">
<param name="pano6" value=" {file=foto/pano6.jpg} {pan=0} {tilt=0} {fov=90} {fovmax=100} {fovmin=80} {auto=0.2} {panmin=-95} {panmax=65} ">
</applet>
When I use Safari browser (4.0.4), the following error report is generated into the Java Console:
java.net.MalformedURLException: no protocol:
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at sun.plugin.liveconnect.SecureInvocation.checkLiveC onnectCaller(Unknown Source)
at sun.plugin.liveconnect.SecureInvocation.access$000 (Unknown Source)
at sun.plugin.liveconnect.SecureInvocation$2.run(Unkn own Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin.liveconnect.SecureInvocation.CallMethod (Unknown Source)
It's important to note that with other browsers (ie: Internet Explorer, Firefox, Chrome) no error is generated.
Can somebody help me? Please consider that I'm a very beginner.
Hi. :)
i think you need to dload this plug ins because safari is using another plugin or maybe u need to use another protocol.
try to read this: Java Embedding Plugin
Cheers,
Truffy. :)
Re: Very beginner - What's wrong in my applet declaration?
Truffy, many thanks for your kind suggestion.
Cheers.
Raffaele
Re: Very beginner - What's wrong in my applet declaration?
Quote:
Originally Posted by
rforte
Truffy, many thanks for your kind suggestion.
Cheers.
Raffaele
Sure, no prob.
Cheers.
:D
Re: Very beginner - What's wrong in my applet declaration?
The applet tag is deprecated and you should instead use object.
See HTML object tag
Code :
<object codetype="application/java" classid="ParametersApplet.class" width=500 height=200 name="PA1">
<param name="name" value="Tri Angle">
<param name="color" value="blue">
<param name="subject" value="math">
<param name="activity" value="reading">
<param name="food" value="bread">
</object>
// Json
Re: Very beginner - What's wrong in my applet declaration?
Thanks Json,
I've followed your suggestion and the folloeing code works with Firefox and IE, but doesn't work with Opera and Safari. Do you have any suggestion how to modify the code to properly work also with Opera and Safari? Please consider that I'm very begginer.
<!--[if !IE]> Firefox and others will use outer object -->
<object id="PanoAPPLET" classid="java:ptviewer.class" type="application/x-java-applet" archive="ptviewer.jar" height="360" width="480" >
<param name="file" value="ptviewer:0"/>
<param name="view_width" value="480"/>
<param name="view_height" value="300"/>
.................................................. ....
<!--<![endif]-->
<!-- MSIE (Microsoft Internet Explorer) will use inner object -->
<object id="PanoAPPLET" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" codebase="http://java.sun.com/update/1.5.0/jinstall-1_5_0-windows-i586.cab" height="360" width="480" >
<param name="code" value="ptviewer" />
<param name="archive" value="ptviewer.jar" />
<strong>This browser does not have a Java Plug-in.<br /><a href="http://java.sun.com/products/plugin/downloads/index.html">Get the latest Java Plug-in here.</a></strong>
<param name="file" value="ptviewer:0"/>
<param name="view_width" value="480"/>
<param name="view_height" value="300"/>
.................................................. ...
</object>
<!--[if !IE]> close outer object -->
</object>
<!--<![endif]-->