Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Very beginner - What's wrong in my applet declaration?

  1. #1
    Junior Member
    Join Date
    Apr 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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.
    Last edited by helloworld922; April 27th, 2010 at 09:17 AM.


  2. #2
    Member Truffy's Avatar
    Join Date
    May 2009
    Location
    Philippines
    Posts
    93
    Thanks
    2
    Thanked 9 Times in 7 Posts

    Default Re: Very beginner - What's wrong in my applet declaration?

    Quote Originally Posted by rforte View Post
    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.

  3. #3
    Junior Member
    Join Date
    Apr 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Very beginner - What's wrong in my applet declaration?

    Truffy, many thanks for your kind suggestion.

    Cheers.
    Raffaele

  4. #4
    Member Truffy's Avatar
    Join Date
    May 2009
    Location
    Philippines
    Posts
    93
    Thanks
    2
    Thanked 9 Times in 7 Posts

    Default Re: Very beginner - What's wrong in my applet declaration?

    Quote Originally Posted by rforte View Post
    Truffy, many thanks for your kind suggestion.

    Cheers.
    Raffaele
    Sure, no prob.

    Cheers.

  5. #5
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default 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

            <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

  6. #6
    Junior Member
    Join Date
    Apr 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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]-->

Similar Threads

  1. Beginner - Help with my code.
    By eddross in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 12th, 2010, 09:30 AM
  2. Basic Beginner Help
    By SRD in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 11th, 2010, 04:27 PM
  3. Java Beginner
    By rannoune in forum Java Theory & Questions
    Replies: 3
    Last Post: December 25th, 2009, 03:30 AM
  4. I need a help ! i am beginner
    By yinky in forum Java Theory & Questions
    Replies: 3
    Last Post: September 30th, 2009, 07:22 AM
  5. Best beginners project in Java
    By Fendaril in forum Java Theory & Questions
    Replies: 3
    Last Post: February 10th, 2009, 08:52 AM