Run applet with object tag

Hi people.
I need your assistance in my problem.
I try to run the simple applet (from Java Tutorial Documents):
import java.applet.Applet;
import java.awt.Graphics;
public class HelloApplet extends Applet {
public void paint(Graphics g) {
g.drawString("Hello Applet!!", 10, 10);
with a help of two different HTMLs.
First with an <APPLET> tag:
<HTML>
<BODY>
<APPLET CODE="dir1.class" WIDTH=150 HEIGHT=25>
</APPLET>
</BODY>
</HTML>
Second with an <OBJECT> tag:
<HTML>
<BODY>
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
     codebase="http://javaweb.eng/plugin/jre-1_2_2-win.exe#Version=1,2,0,0"
     align="left" border="0" width="100%" height="100%">
<param name="code" value="dir2.class">
<param name="codebase" value="./">
<param name="type" value="application/x-java-applet;version=1.2">
</OBJECT>
</BODY>
</HTML>
The problem is that in case of <APPLET> tag everything is OK.
In case of <OBJECT> tag the applet don�t run.
And that is only on my machine.
On the others everything is OK in both cases.
HELP!!!
My machine properties:
     Win95
     IE5.5
PlugIN: jre1_2_2-win.exe

Hmmm... I've already seen the Java Plugin going mad if you make too much experimentations with it.
My advice : uninstall it properly and make it be reinstalled by the automatic plugin installation of IE (just by loading the HTML page with the <OBJECT> tag).
I hope it will work...
Matthieu

Similar Messages

  • Applet doesn't work with object tags--PLZ HELP!

    <NOEMBED>
    </NOEMBED>
    </EMBED>
    </COMMENT>
    </OBJECT>

    ooops! The applet is not displayed with object tags generated by HtmlConverter utility, The applet is supposed to display a JTable and connect to Oracle DB using JDBC. The web server is Tomcat 4.1.29
    <OBJECT
        classid = "clsid:CAFEEFAC-0014-0001-0002-BBCDEFFEDCBA"
        codebase = "http://java.sun.com/products/plugin/autodl/jinstall-1_4_1_02a-windows-i586.cab#Version=1,4,1,21"
        WIDTH = 800 HEIGHT = 500 NAME = "Edit Trunks" >
        <PARAM NAME = CODE VALUE = "cbhtolApplet.class" >
        <PARAM NAME = ARCHIVE VALUE = "trnkapplet.jar,ojdbc14.jar" >
        <PARAM NAME = NAME VALUE = "Edit Trunks" >
        <PARAM NAME = "type" VALUE = "application/x-java-applet;jpi-version=1.4.1_02a">
        <PARAM NAME = "scriptable" VALUE = "false">
        <COMMENT>
            <EMBED
                type = "application/x-java-applet;jpi-version=1.4.1_02a"
                CODE = "cbhtolApplet.class"
                ARCHIVE = "trnkapplet.jar,ojdbc14.jar"
                NAME = "Edit Trunks"
                WIDTH = 800
                HEIGHT = 500
                scriptable = false
               pluginspage = "http://java.sun.com/products/plugin/index.html#download">
                <NOEMBED>
                </NOEMBED>
            </EMBED>
        </COMMENT>
    </OBJECT>Appreciate your help!

  • JDK 1.4.2_10; problem with applet/classpath/OBJECT tag

    I'm supporting an applet that needs to run in JDK 1.4.2_10 in order to work. (I don't own the code, so I can't fix the issue)
    I'd like to force that particular applet to run under JDK 1.4.2_10, but allow other applets to run on the current default JVM.
    I'm trying to do this by using the JDK's htmlconverter.exe utility to force the use of JDK 1.4.2_10. That part is working as expected, but I'm experiencing a side effect.
    The problem is that, when I use the OBJECT tag instead of the APPLET tag, the browser attempts to download the class with this URL
    http://hostname.here.com/app.testing/app.testbed/classes/appls%2fDOLARS%2fuser%2fApplet%2fclass.class
    instead of this URL
    http://hostname.here.com/app.testing/app.testbed/classes/appls/DOLARS/user/Applet.class
    The second URL works; the first does not. When I use the APPLET tag, it generates the second URL and downloads the class successfully.
    I'd like to a) use the OBJECT tag. b) get it to use the correct URL to download the Applet.class file. What do I need to do to make this happen?
    Thanks,
    Tom Valesky

    Here's the exception I'm getting (slightly sanitized):
    Java Plug-in 1.4.2_10
    Using JRE version 1.4.2_10 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\tvalesky
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to
    load: class appls/DOLARS/user/Applet.class not found.
    java.lang.ClassNotFoundException: appls.DOLARS.user.Applet.class
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed:http://hostname.com/DOLARS.testing/dolars.testbed/classes/appls%2fDOLARS%2fuser%2fApplet%2fclass.class
         at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 7 more
    Exception: java.lang.ClassNotFoundException: appls.DOLARS.user.Applet.class

  • Applet in Object tag IE8

    Hi Ppl,
    I have got a requirement where i need to invoke an applet from browser and should be working across all browsers. Since APPLET tag is deprecated since HTML4, i was trying to use OBJECT tag to embed it, and it works fine in FF and Chrome, but in IE8 it doesnt work.Any thoughts on how to make it work on IE8 and above?
    The HTML file is something like below
    <!doctype html>
    <object
    width="0px" height="0px" tabIndex="-1"
    classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    codeBase="https://java.sun.com/update/1.6.0/jinstall-6u16-windows-i586.cab#Version=1,4,2"
    type="application/x-java-applet" >
    <param name="archive" value="applettext.jar" />
    <param name="code" value="DrawingLines" >
    <param name="mayscript" value="yes">
    <param name="scriptable" value="true">
    </object>

    841335 wrote:
    ..I have got a requirement where i need to invoke an applet from browser and should be working across all browsers. .. That will never happen. There is always some browser/JRE/applet interaction bug. Besides that, some end users do not have Java installed and either will not (through personal choice) or cannot (through system administrator choice) install it.
    ..Since APPLET tag is deprecated since HTML4, i was trying to use OBJECT tag to embed it, ..Don't. Instead use Oracle's deployJava.js to check for a minimum JRE, prompt the user to install it if missing, and launch the applet.
    The HTML file is something like below2 points.
    <li> When posting code, code snippets, HTML/XML or input/output, please use the code tags as described on the 'sticky post' on the top of the forum thread listing.
    <li> Please do not waste you time, or attempt to waste mine, with any of the above that is +'something like'+ what you have. Either copy/paste it, or don't waste the bandwidth.

  • Applet or Object tag attributes

    Hi everyone,
    Here is my question :
    I'm loading the same applet 2 times in the same html page.
    I would like all classes to be loaded for each of those 2 applets and not only one time as it happens right now, but always using the same .jar file of course.
    I read once that depending on the attributes you enter in the <applet> tag in your html code, classes will be loaded for each <applet> or not.
    For example :
    <applet name="app1" code="code.jar" id="applet1">
    <applet name="app2" code="code.jar" id="applet1">
    --> classes are loaded just one time and used for app1 and app2
    <applet name="app1" code="code.jar" id="applet1">
    <applet name="app2" code="code.jar" id="applet2">
    --> classes are loaded for each applet ( app1 and app2 )
    What I have just written in my example is wrong, actually I would like to retrieve those rules that make an <applet> tag to reload every classes.
    I hope you can understand what I mean.
    Thanx a lot for any help.

    try this
    <APPLET code="app1.class" width="200" height="200" ARCHIVE="code.jar">
    </APPLET>
    <APPLET code="app2.class" width="200" height="200" ARCHIVE="code.jar">
    </APPLET>
    but applet is deprecated with <OBJECT>
    hi Alex

  • Error while running JSP with custom tag

    I am trying to run a jsp with a tag and I am getting the following error when I run the jsp:
    "Unable to open taglibrary /WEB-INF/jsp/mytaglib.tld : Parse Error in the tag library descriptor: External parameter entity "%(DOCTYPE);" has characters after markup."
    I have no idea what this is, can anyone help me here?
    tx
    -AB

    Its difficult to tell without looking at your TLD file i.e. mytaglib.tld
    However, a guess is that you may be refering to an invalid or otherwise corrupted DTD from your TLD.
    Check that out.
    The official DTD for TLDs in JSP 1.1 is http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd
    and the official DTD for TLDs in JSP 1.2 is http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd

  • Can't run applet with appletviewer(java.io.FilePermission)

    Guys, I am writing an applet and it has compiled fine but when I try running it with appletviewer, it spews out these error. I have changed permissions on my .class file and .html file.
    Can anyone help? It's pretty frustrating...
    ava.security.AccessControlException: access denied (java.io.FilePermission /.automount/blah/usr/blah/blah/Node.class read)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
    at java.security.AccessController.checkPermission(AccessController.java:399)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
    at java.lang.SecurityManager.checkRead(SecurityManager.java:890)
    thanks.

    See if you find anything here:
    http://search.java.sun.com/search/java/index.jsp?col=javaforums&qp=%2Bforum%3A31&qt=%22java.security.AccessControlException%3A+access+denied+%22&x=17&y=14
    It�s a search on the forum, users with the same error.
    Andreas

  • Problem running applet with JRE 1.3.X

    Hi,
    I've developed an applet that works fine with MS JVM and JRE 1.4, but fails under JRE 1.3.x.
    Anyone knows what i've todo to my applet to get compability with JRE 1.3x too.
    Thanks,
    rjc

    Are you compiling under 1.3x and then trying to run in MS and 1.4? If so please tell the errors you are getting when you compile or what you're having problems in.
    You're question is like me saying I have a feild full of volvo's from various years and I have a box of replacement parts from vaious years--but not nessisarally the same years as I have cars, which ones do I need to fix them? (impossible to say isn't it without more info)
    or as I usually say: "My crystal ball is in the shop, please supply specific information for what you want answered."

  • How to run Applets with any plug-in version = clsid version.

    I to be able to have any version of the plug-in equal or greater than that specified by the clsid and if they don't then download the plug-in version specified by the CODEBASE. This is what its says it is surposed to do in the dev notes(http://java.sun.com/products/plugin/versions.html) but its doesn't work unless I am doing something wrong.
    Example:
    I currently have version 1.4.1_01 installed and if I set the clsid to:
    clasdid="clsid:CAFEEFAC-0014-0000-0000-ABCDEFFEDCBA"
    it prompts to download the lastest version which I have specified in the CODEBASE(ie 1.4.1_01):
    CODEBASE="http://java.sun.com/products/plugin/autodl/jinstall-1_4_1_01-windows-i586.cab#version=1,4,1,0,1"
    I am expecting it to just load the version I have as its already greater than the clsid version.
    I have also used clsid:CAFEEFAC-0014-0001-0000-ABCDEFFEDCBA and this does the same.
    I have also tried with clasdid="clsid:8AD9C840-
    044E-11D1-B3E9-00805F499D93" which is the any plug-in clsid and it does exactly that and just uses any version and does not prompt to install 1.4 when a machine is already has 1.3.

    I guess I don't understand what you are asking. As I see it you ask a question and then provide the answer yourself.
    To make it absolutely clear: The way to require a minimum JRE version is to use clsid:8AD9C840-044E-11D1-B3E9-00805F499D93 as the classid. This is called dynamic versioning and is described in the "Java Plug-in 1.4.1 Developer Guide": C:\doc\java\1.4.1\docs\guide\plugin\developer_guide\using_tags.html
    I don't think there is any other way. And I can't see why you would need another way.

  • Applet registered through object tag doesn't work

    Hi..
    If i register an applet through <OBJECT> tag, the applet doesn't appear, but if registering through <applet> tag, it works.
    what happens?
    is there anybody can tell me why?

    The html <object> codes used are below.
    <OBJECT
    classid = "clsid:CAFEEFAC-0014-0002-0004-ABCDEFFEDCBA"
    codebase = "http://java.sun.com/update/1.4.2/jinstall-1_4_2_04-windows-i586.cab#Version=1,4,2,40"
    WIDTH = 100 HEIGHT = 100 >
    <PARAM NAME = CODE VALUE = "MyApplet.class" >
    <PARAM NAME = "type" VALUE = "application/x-java-applet;jpi-version=1.4.2_04">
    <PARAM NAME = "scriptable" VALUE = "false">
    <PARAM NAME = MAYSCRIPT VALUE = true >
    </OBJECT>
    and the parent html file that contain "<iframe> tag" portion is written as below
    <iframe src=iframe_testApplet.htm name=AppletLoader frameborder="no" height=150 width=150 scrolling="no"></iframe>
    and all the parent html file and the iframed-file and the class file is in the same directory. so i didn't specify the "codebase" attribute above. and moreover, when i put a code that specifies the codebase though, it doesn't still work.
    the code specifying codebase is like this.
    <PARAM NAME = CODEBASE VALUE=".">
    I just want to let know that actually I solved above problem just before with some minor change. but I still want to know why it works at this time because there is not so much difference between before and after.
    the change I did is
    1. I rewrite all html code into jsp code
    2. in the jsp code, I specify the codebase with "<%= request.getContextPath()%>/aPath"
    But as you can see, the code base is the directory that contains all the files, parent html file, iframed file and a classFile, although I changed some minor codes, that cannot make it work if it doesn't work without the minor code-change because eventually it has same context from code viewpoints.
    As of now, I just take it as just a JRE bug. Can anyone let me know why it happens?

  • Applet OBJECT tag to install 1.6.0.22 - harder than you think!

    Hi there,
    Using the OBJECT tag, I've placed an applet on a webpage. I need the user to download the JRE if it's not installed, so I added this attribute to my OBJECT tag and it seems to work.
    codebase="http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab"
    Unfortunately, right now this causes jre 1.6.0.18 to be installed, which consistently crashes once the install has completed, requiring the user to close the browser and return before viewing the applet (known issue I believe "http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=5288ea4b825d095f0bf29977ada?bug_id=6925315").
    I therefore want the more recent 1.6.0.22 version to be installed instead which won't crash, but I cannot figure out what to change the codebase attribute to accomplish this. It always seems to install 1.6.0.18! I've also tried the following without success:
    codebase="http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab#Version=1,6,0,0"
    codebase="http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab#Version=1,6,0,99"
    codebase="http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab#Version=1,6,0,22"
    Any tips would be immensly helpful!

    Cross posted
    http://www.java-forums.org/java-applets/35025-object-tag-automatically-install-1-6-0-22-since-1-6-018-crashes.html
    Any more?
    db

  • I can load an Applet .class file with an OBJECT tag...

    How can I load a .jar file? I foolishly believed I could replace "myclass.class" with "myjar.jar" in the <PARAM> tag associated with an <OBJECT> tag, and if I had created my manifest file correctly, the Main-Class in my .jar would have its init() method called upon IE load of the web-page. But alas, it is not that simple.
    Is there an incantation of the <OBJECT> tag that is appropriate for .jar files?
    Thanks in advance for any help you can provide in this area.

    Please ignore the duplication. My browser burped, and I can't seem to figure out how to delete a thread.
    See answer posted in other thread.

  • APPLET   vs. EMBED or OBJECT tag in JDeveloper

    HI Gentlemen,
    Recently I learned from ADF Code Corner, Item 71, how to set up a client/server communication applet for an ADF application. The solution uses the JavaScript framework on the client. However, it is also stated that "Note that the APPLET tag is used instead of the EMBED or OBJECT tag that would be needed to explicitly invoke Java run by the Java PlugIn." This suggests that I can write a Java program independent of my ADF application which could control a local smartcard reader (this already works fine with German KVK and eGK). Now I would like to trigger this external Java program in my .jspx page to read the contents of a card and communicate it to the page. If this were possible, I could avoid JavaScript at all. It must be installed on the client to access a local smartcard reader. Please drop a few lines where can I find guidance or a working example if any.
    Thanks, kind regards
    Miklos HERBOLY

    Hi,
    if you want to talk to ADF Faces pages on the client side then this through JavaScript. The other alternative is to allow the Applet to perform a server side update (object or database) and then have the ADF Faces app checking for it (af:poll or Active Data Services).
    Frank

  • applet tag vs Object tag

    As per W3Schools HTML applet tag is not supported in HTML5. Need to use <Object> tag instead of <applet> tag.
    For more details follow this link: http://www.w3schools.com/tags/tag_applet.asp
    http://dev.w3.org/html5/spec/obsolete.html#the-applet-element
    Point 11.2 Non-conforming features
    So, I go ahead and the change the code as below depicted.
    Below code that is working with <APPLET> tag:
    +<Applet+
    style    = "position:absolute;border:0px;left:184;top:95;height:180;width:364;"
    code     = "jtreeviewapplet.JTreeViewAppletMain.class"
    name     = "TreeView"
    id       = "TreeView"
    hspace   = "0"
    vspace   = "0"
    align    = "top"
    archive  = "/Project/HTML/ABC/XYZ.jar,/Project/HTML/ABC/ABC.jar"
    MAYSCRIPT>
    +<PARAM NAME="onSelected" VALUE="onSelect_Handler">+
    +<PARAM NAME="onFinishNormalize" VALUE="onFinishNormalize_Handler">+
    +</Applet>+
    Here is the snippet, whcih have been changed to <OBJECT> tag so as to support HTML5 in future:
    +<OBJECT type=" application/x-java-applet"+
    style    = "position:absolute;border:0px;left:184;top:95;height:180;width:364;"
    name     = "TreeView"
    id       = "TreeView"
    hspace   = "0"
    vspace   = "0"
    align    = "top"
    +>+
    +<PARAM name="code" value=”jtreeviewapplet.JTreeViewAppletMain.class”>+
    +<PARAM name="codebase" value="/Project/HTML/ABC/">+
    +<PARAM name="archive" value=" XYZ.jar">+
    +<PARAM name="archive" value=" ABC.jar">+
    +<PARAM name="scriptable" value="true">+
    +<PARAM NAME="onSelected" VALUE="onSelect_Handler">+
    +<PARAM NAME="onFinishNormalize" VALUE="onFinishNormalize_Handler">+
    +</OBJECT>+
    After changing the *<applet>* tag to *<object>* tag , my applet itself is not loading and it gives class not found exception for jtreeviewapplet.JTreeViewAppletMain.class.
    (Note: For both working and not working condition, I am using latest JDK 1.7 update 9 for compiling the code and in my system I am having latest JRE1.7 update 9 to run the applet code. I am using InternetExplorer 8 and InternetExplorer 9 browser)
    Can anybody help me to find out where I am going wrong?
    Edited by: 975931 on Dec 12, 2012 1:24 AM

    You might want to stick to the documentation:
    http://docs.oracle.com/javase/tutorial/deployment/index.html
    and use the deployment toolkit.
    PS: use \ tags when posting anything code related. That makes it readable and it keeps the forum from trying to interpret it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Object tag not downloading jars with JRE 1.4.2 and above

    Hi All,
    I have a HTML page and following object tag in it:
    <OBJECT id = obj classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH="0" HEIGHT="0">
    <PARAM NAME ="code" VALUE="VIP6.class">
    <PARAM NAME ="archive" VALUE="vipjar.jar,vipserver.jar,powerj.zip">
    <PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.4">
    <PARAM NAME="scriptable" VALUE = "true">
      <br>
      <P>
      <H2>The Java 2 plugin is required for this application.  Please call Application Support or the Inventory Hotline<br>
    </H2>
      </P>
    </OBJECT>Above OBJECT tage downloads files vipjar.jar,vipserver.jar and powerj.zip on user's machine when page is browsed using JRE version 1.3.1. But when JRE version 1.4.2 and above is used then the jar's doesn't get downloaded and the application does not find the neccessary class files for execution.
    Please advice what needs to be done so that the object tag runs correctly with JRE version's 1.4.2 and above.
    Thanks in advance for any help.
    Vineet

    Hello,
    Indeed those JAR files are compiled with JDK 1.3. However, the AS Java systems are running 1.4.x, hence, there is no problem to use those JARs with the JRE 1.4. That's why I do not believe your issue is related to the JRE version. In addition, those JAR files do not have 1.4 compiled version.
    Kind regards,
    Tsvetomir
    Edited by: Tsvetomir Tsvetanov on Jun 9, 2009 5:47 PM

Maybe you are looking for