File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

plugin download problem in applet using swing

 
Mandar Bendre
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I am having a applet in which swing is used for JTree and drag-n-drop.I am using html converter 1.1.3 to display it IE browser.I have the plugin on my machine so its getting displayed properly. But on different client machine plug in is not there, so when applet gets loaded in browser, it asks for plugin. When we start downloadin plugin from Sun site,after some percent of download, it gives error like file is corrupted and application can not be run.
Please suggest me the solution for this.
thanx in advance
Mandar
 
Julia Reynolds
Ranch Hand
Posts: 123
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The workaround for this problem involves using Sun�s free HTML Converter(http://java.sun.com/products/plugin/1.3/docs/html_converter.html) for use with Swing applets. The HTML Converter is a tool that automatically converts applet tags to the format required by the Java Plug-in, directing the browser to install and run the plugin jvm instead of its own jvm. You create a standard applet tag to display your Swing applet:
<APPLET CODE = "SwingApplet.class" WIDTH = 500 HEIGHT = 550>
<PARAM NAME = CODE VALUE = �SwingApplet.class" >
<PARAM NAME = CODEBASE VALUE = "classes" >
<PARAM NAME = ARCHIVE VALUE = "SwingApplet.jar" >
<PARAM NAME = TYPE VALUE ="application/x-java-applet;version=1.3">
</APPLET>
After running the HTML Converter your original applet tag is automatically commented out and replaced with an OBJECT (IE) and EMBED (Netscape) tag, as shown:
< !--"CONVERTED_APPLET"-->
< !-- CONVERTER VERSION 1.3 -->
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
WIDTH = 500 HEIGHT = 550 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0" NAME="SwingApplet">
<PARAM NAME = NAME VALUE = "SwingApplet.class" >
<PARAM NAME = CODE VALUE = " SwingApplet.class" >
<PARAM NAME = CODEBASE VALUE = "classes" >
<PARAM NAME = ARCHIVE VALUE = "SwingApplet.jar" >
<PARAM NAME=TYPE VALUE="application/x-java-applet;version=1.3">
<PARAM NAME="scriptable" VALUE="false">
<COMMENT>
<EMBED type="application/x-java-applet;version=1.3" NAME="SwingApplet" CODE = " SwingApplet.class" CODEBASE = "classes" ARCHIVE = "rtf.jar" WIDTH = 500 HEIGHT = 550 type = "application/x-java-applet;version=1.3" scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html">
<NOEMBED>
</COMMENT>
</NOEMBED></EMBED>
</OBJECT>
It works like a charm.
Julia

[This message has been edited by Julia Reynolds (edited June 29, 2001).]
 
Mandar Bendre
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Thanx for ur reply .But that is exactly what i had done . I had a simple applet tag and i used HTMLConverter ver 3.0 to convert it after which it started running fine on my machine , but when I tried running that applet on a machine that does not have the plug-in already installed , it asks for the download of the plug-in , and if I click on 'Yes' , it starts downloading the 4.9 MB file from the Sun site , but after sometime it flashes an error saying it cannot run the application as some particular file is corrupted and the download stops , making my applet non runnable on that machine. Please help .
Mandar
 
Julia Reynolds
Ranch Hand
Posts: 123
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does your converted applet tag look like? What browser are you having the problem on?
Julia
 
Mandar Bendre
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following is my object tag . The download of the win32.cab file on the Sun site seems to have some bug . Can you please suggest an alternative ?
< !--"CONVERTED_APPLET"-->
< !-- CONVERTER VERSION 1.3 -->
<OBJECT id="TextApplet" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
WIDTH = 500 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0" NAME="testdom">
<PARAM NAME = NAME VALUE = "testdom.class" >
<PARAM NAME = CODE VALUE = "testdom.class" >
<PARAM NAME = CODEBASE VALUE = "classes" >
<PARAM NAME = ARCHIVE VALUE = "jaxp.jar,xalan.jar,crimson.jar,xml.jar,xerces.jar">
<PARAM NAME="scriptable" VALUE="true">
<COMMENT>
<EMBED type="application/x-java-applet;version=1.3" NAME="SwingApplet" CODE = " testdom.class" CODEBASE = "classes" ARCHIVE = "rtf.jar" WIDTH = 500 HEIGHT = 550 type = "application/x-java-applet;version=1.3" scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html">
<NOEMBED>
</COMMENT>
</NOEMBED></EMBED>
</OBJECT>

[This message has been edited by Mandar Bendre (edited July 03, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic