Applet tag accessing JAR file

hi,
I hope this is not a multi-post, I've searched high and low and I could not find an exact solution to my question...
How can I load an applet in a browser using an applet tag? My main class is com.my.applet.MainClass.class and the its in a JAR. The jar is in ProjectName/WebContent/WEB-INF/lib/MyJar.jar (a Dynamic Web Project).
Thx in advance

i guess there is no solution for this one... i placed it in a resource folder instead... thx everyone...

Similar Messages

  • applet tag regarding JAR file

    Is there something wrong with the following applet declaration?
    <applet code = "Sheep2.class" archive="Sheep2.jar" width = 500 height = 300
    ALT="If you could run this applet, you'd see a sky, a field, and a moon.">
    Your browser is completely ignoring the <APPLET> tag!
    </applet>
    Works fine (it seems) on my Windows 98 computer with IE 6.0280, but does not work on the same computer when I access the page calling the applet using AOL's v.9 browser.
    I used HtmlConverter to convert the above to Extended version (covering all platforms), and still does not work with AOL's browser. HtmlConverter reported no errors, but now IE shows an error icon in its status bar when I access the page even offline.
    Other html files I converted using HtmlConverter work fine with AOL's browser. They don't have "archive" attribute.
    What could be going wrong? My guess is JAR file reference is causing problems.

    I did more Html Conversion today. I ran one file which didn't show any error mark in the status bar of IE through HtmlConverter. I ran the new file generated by HtmlConverter and an error icon appeared in the status bar of IE. My Java Console didn't show any message. So, it must be an error in the applet related info HtmlConverter generated was not 100% html compliant..
    BTW, I started speculating the cause of my applets not working on the computer of oen of my friends is simply that her Java Plug-in cannot handle Swing components' J classes.

  • Unable to access jar file error !

    hello,
    i have built my netbeans project and obtained the hequalifies.jar file . unfortunately when i'm trying to run this jar file from the prompt command I'mgetting the error: unable to access jar file
    here is the command i'm typing:
    C:\Users\User\Documents\NetBeansProjects\hEqUALIFIES\dist>java -jar " C:\Users\U
    ser\Documents\NetBeansProjects\hEqUALIFIES\dist hequalifies.jar "
    anyone has any clue?
    10x!

    ok i'm gonna make it easier on you.
    i gess i found what is the problem but have no idea how to solve it.
    when i obtained the .jar file i also obtained a README.txt file in which it is written the following phrase:
    ** If a library on the projects classpath also has a Class-Path element*
    specified in the manifest,the content of the Class-Path element has to be on the projects runtime path.
    I'M SORRY BUT I DID NOT UNDERSTAND WHAT IS MEANT BY: what is "the projects runtime path"?
    the content of my manifest is:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.1
    Created-By: 10.0-b23 (Sun Microsystems Inc.)
    Main-Class: hequalifies.ui.HeQualifies
    Class-Path: lib/PlugIn
    X-COMMENT: Main-Class will be added automatically by build
    I'm having problem with lib/plugin.

  • Error message at start-up Unable to access Jar file

    I am a consumer, not a business...and not an IT professional. I am running Vista and have not installed any new software recently.
    At every start-up, I get a pop-up titled Java Virtual Machine Launcher. The message says "Unable to access jar file". C:\users\user\.jnana.jnana.tsa.
    Any idea how to fix this?
    Thanks in advance.
    Edited by: 794979 on Sep 15, 2010 5:31 AM

    ok i'm gonna make it easier on you.
    i gess i found what is the problem but have no idea how to solve it.
    when i obtained the .jar file i also obtained a README.txt file in which it is written the following phrase:
    ** If a library on the projects classpath also has a Class-Path element*
    specified in the manifest,the content of the Class-Path element has to be on the projects runtime path.
    I'M SORRY BUT I DID NOT UNDERSTAND WHAT IS MEANT BY: what is "the projects runtime path"?
    the content of my manifest is:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.1
    Created-By: 10.0-b23 (Sun Microsystems Inc.)
    Main-Class: hequalifies.ui.HeQualifies
    Class-Path: lib/PlugIn
    X-COMMENT: Main-Class will be added automatically by build
    I'm having problem with lib/plugin.

  • Class not found in applet using 2 jar files

    I have an applet which has been working for years as a stand alone or connecting directly to a derby database on my home server. I have just changed it to connect to MySQL on my ISP server via AJAX and PHP.
    I am now getting a class not found error in my browser, probably because I'm stuffing up the class path.
    The HTML I am using to call the applet is:
    <applet code="AMJApp.class"
    codebase="http://www.interactived.com/JMTalpha"
    archive="AMJ014.jar,plugin.jar"
    width="500"height="500"
    MAYSCRIPT style="border-width:0;"
    name="jsap" id="jsap"></applet>The AMJ014.jar contains the applet and supporting class files.
    The error message is strange to me because it refers to a class I noticed on another web page but which has nothing to do with my applet. Anyway, the message in full is:
    load: class NervousText.class not found.
    java.lang.ClassNotFoundException: NervousText.class
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.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)
    Exception: java.lang.ClassNotFoundException: NervousText.class
    java.lang.UnsupportedClassVersionError: AMJApp : Unsupported major.minor version 51.0
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClassCond(Unknown Source)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.defineClass(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.defineClassHelper(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.access$100(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.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)
    Exception: java.lang.UnsupportedClassVersionError: AMJApp : Unsupported major.minor version 51.0

    Thanks again.
    The page code is:
    <html>
    <head>
      <title>Applet to JavaScript to PHP</title>
    </head>
    <body>
    <script type="text/javascript">
    function updateWebPage(myArg)
    document.getElementById("txt1").innerHTML=myArg;
    if (myArg=="")
      document.getElementById("cbxItem").innerHTML="";
      return;
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
    else
      {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    xmlhttp.onreadystatechange=function()
      if (xmlhttp.readyState==4 && xmlhttp.status==200)
        document.getElementById("cbxItem").innerHTML=xmlhttp.responseText;
    xmlhttp.open("GET","putitem.php?id="+myArg,true);
    xmlhttp.send();
    </script>
    <form>
    <table border=1 align='center' cellpadding=0 cellspacing=0 >
    <tr><td style='text-align:center; background-color:#C0C0C0'>Compiled Java Applet</td></tr>
    <tr><td><applet code="AMJApp.class" codebase="http://www.interactived.com/JMTalpha" archive="AMJ014.jar" width="500"height="500" MAYSCRIPT style="border-width:0;" name="jsap" id="jsap"></applet> </td></tr>
    <tr><td style='text-align:center; background-color:#C0C0C0'>HTML Textbox filled by JavaScript</td></tr>
    <tr><td><textarea style='width:500px; height:50px' name='txt1' id='txt1'>Query goes here</textarea></td></tr>
    <tr><td style='text-align:center; background-color:#C0C0C0'>HTML diagnostic messages rendered by PHP script</td></tr>
    <tr><td><div id="cbxItem">PHP info will populate this space</div></td></tr>
    </table>
    </form>
    </body>
    </html>The URL of the problem page is:
    http://www.interactived.com/JMTalpha/AMJTest.htm
    The code in the page is based on the following test page, which works:
    http://www.interactived.com/test5Applet.htm
    And the Applet, before I made any changes can be seen at this address:
    http://www.interactived.com/jartest0906.htm
    Thanks again for you interest.
    Edited by: 886473 on 21-Sep-2011 00:47

  • Applet in a .jar file?

    I want to program a program which can be used as application or as applet. Is it possible to create a .jar file and use something inside as applet? What would the <applet> tag look like?

    Sorry, I guess I thought you had this working already. In any case, here is an example of some JApplet code that runs either as an applet on a web page or as an application in a JFrame. It is the applet from the html-applet tag example I provided above. It is missing some classes, so it won't compile of course, but it shows all the applet vs. application code. This methodology also works in older non-swing applets ...just follow a technique similar to what you see below:
    If you didn't need to see this ...please just ignore it. Good luck.
    /** Applet or application example. */
    public class RasterGameOfLife extends javax.swing.JApplet {
      RasterLifeCanvas canvas;                // The drawing area
      RasterLifeCanvas.LifeControls controls; // The drawing controls
      /** the applets init method sets up some gui components */
      public void init() {
        canvas = new RasterLifeCanvas();
        controls = canvas.getControls();
        getContentPane().setLayout( new java.awt.BorderLayout() );
        getContentPane().add( "Center", canvas );
        getContentPane().add( "South", controls );
      /** the applets destroy method cleans up after execution */
      public void destroy() {
        remove( controls );
        remove( canvas );
      /** the applets start method enables and begins an animation sequence */
      public void start() {
        controls.setEnabled( true );
        controls.startAnimation();
      /** the applets stop method stops and disables an animation sequence */
      public void stop() {
        controls.stopAnimation();
        controls.setEnabled( false );
       * main is where the alternative application code is placed
       * this code does not execute when the program is run as an applet
      public static void main(String args[]) {
        javax.swing.JFrame f = new javax.swing.JFrame();      // create a JFrame for the application
        final RasterGameOfLife life = new RasterGameOfLife(); // create an instance of the applet
        life.init();     // Manually call the init method
        life.start();    // Manually call the start method
        f.addWindowListener( new java.awt.event.WindowAdapter() {
          public void windowClosing( java.awt.event.WindowEvent e ) {
            life.stop(); // Manually call the stop method
            System.exit(0);
        f.getContentPane().add( "Center", life );
        // or sometimes I use this alternative to get the applets contentPane
        //f.getContentPane().add( "Center", life.getContentPane() );
        f.setSize( 734, 435 );
        f.show();
    }

  • Problem deploying and using custom Tags in jar files

    I am trying to create a custom tag library of Java classes, package them in a JAR file, and use them in another web application. Here is the JAR file structure, named mytags.jar:
    META-INF
    META-INF/manifest.mf
    META-INF/taglib.tld
    mytags/FooBar.class
    mytags/Another.class
    ...Here is the taglib.tld file:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <taglib xmlns="http://java.sun.com/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
    version="2.0">
       <tlib-version>1.0</tlib-version>
       <short-name>foo</short-name>
       <uri>fooTags</uri>
       <info>My tags</info>
       <tag>
         <name>fooBar</name>
         <tag-class>mytags.FooBar</tag-class>
         <body-content>empty</body-content>
         <attribute>
           <name>name</name>
           <required>false</required>
           <rtexprvalue>true</rtexprvalue>
         </attribute>
      </tag>
    </taglib>The FooBar class has getName(String) and setName() methods.
    In the web application, I have copied mytags.jar into the WEB-INF/lib directory. I've verified that it lands in the corresponding directory for my appserver (I'm using Tomcat 6.0.10).
    Here's the header for my JSP:
    <%@ page language="java" contentType="text/html;charset=UTF-8" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib uri="fooTags" prefix="foo" %>
    <foo:fooBar name="dummy" />
    ...When I access my page, the browser sits there and spins, not able to do anything. I know that some of the content is executed, but it is not able to get to the fooTags. I have tried replacing fooTags with WEB-INF/lib/mytags.jar, to no effect.
    According to the docs, I should not need to include anything in web.xml to reference the fooTags. The tag library classes are valid, since I used them as local tags prior to moving them into a Jar library.
    Any help would be appreciated

    Take the code of the jsp file :
    <%@ page language="java" %>
    <%@ taglib uri="WEB-INF/struts-html.tld" prefix="html" %>
    <html>
       <head>
         <title> First Struts Application </title>
       </head>
         <body>
            <table width="500" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td> </td>
            </tr>
            <tr bgcolor="#36566E">
              <td height="68" width="48%">
                <div align="left">
                  <img src="images/hht.gif" width="220" height="74">
                </div>
              </td>
            </tr>
            <tr>
             <td> </td>
            </tr>     
           </table>
           <html:form action="Lookup"
                      name="lookupForm"
                      type="wiley.LookupForm" >
           <table width="45%" border="0">
            <tr>
              <td>Symbol:</td>
              <td><html:text property="symbol" /> </td>
            </tr>
             <tr>       
              <td colspan="2" align="center"><html:submit/> </td>
             </tr>       
            </table>              
          </html:form>
         </body>
    </html>

  • Loading an image into an Applet from a JAR file

    Hello everyone, hopefully a simple question for someone to help me with!
    Im trying to load some images into an applet, currently it uses the JApplet.getImage(url) method just before registering with a media tracker, which works but for the sake of efficiency I would prefer the images all to be contained in the jar file as oppossed to being loaded individually from the server.
    Say I have a class in a package eg, 'com.mydomain.myapplet.class.bin' and an images contained in the file structure 'com.mydomain.myapplet.images.img.gif' how do I load it (and waiting for it to be loaded before preceeding?
    I've seen lots of info of the web for this but much of it is very old (pre 2000) and im sure things have changed a little since then.
    Thanks for any help!

    I don't touch applets, so I can't help you there, but here's some Friday Fun: tracking image loading.
    import java.awt.*;
    import java.awt.image.*;
    import java.beans.*;
    import java.io.*;
    import java.net.*;
    import javax.imageio.*;
    import javax.imageio.event.*;
    import javax.imageio.stream.*;
    import javax.swing.*;
    public class ImageLoader extends SwingWorker<BufferedImage, Void> {
        private URL url;
        private JLabel target;
        private IIOReadProgressAdapter listener = new IIOReadProgressAdapter() {
            @Override public void imageProgress(ImageReader source, float percentageDone) {
                setProgress((int)percentageDone);
            @Override public void imageComplete(ImageReader source) {
                setProgress(100);
        public ImageLoader(URL url, JLabel target) {
            this.url = url;
            this.target = target;
        @Override protected BufferedImage doInBackground() throws IOException {
            ImageInputStream input = ImageIO.createImageInputStream(url.openStream());
            try {
                ImageReader reader = ImageIO.getImageReaders(input).next();
                reader.addIIOReadProgressListener(listener);
                reader.setInput(input);
                return reader.read(0);
            } finally {
                input.close();
        @Override protected void done() {
            try {
                target.setIcon(new ImageIcon(get()));
            } catch(Exception e) {
                JOptionPane.showMessageDialog(null, e, "Error", JOptionPane.ERROR_MESSAGE);
        //demo
        public static void main(String[] args) throws IOException {
            final URL url = new URL("http://blogs.sun.com/jag/resource/JagHeadshot.jpg");
            EventQueue.invokeLater(new Runnable(){
                public void run() {
                    launch(url);
        static void launch(URL url) {
            JLabel imageLabel = new JLabel();
            final JProgressBar progress = new JProgressBar();
            progress.setBorderPainted(true);
            progress.setStringPainted(true);
            JScrollPane scroller = new JScrollPane(imageLabel);
            scroller.setPreferredSize(new Dimension(800,600));
            JPanel content = new JPanel(new BorderLayout());
            content.add(scroller, BorderLayout.CENTER);
            content.add(progress, BorderLayout.SOUTH);
            JFrame f = new JFrame("ImageLoader");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setContentPane(content);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
            ImageLoader loader = new ImageLoader(url, imageLabel);
            loader.addPropertyChangeListener( new PropertyChangeListener() {
                 public  void propertyChange(PropertyChangeEvent evt) {
                     if ("progress".equals(evt.getPropertyName())) {
                         progress.setValue((Integer)evt.getNewValue());
                         System.out.println(evt.getNewValue());
                     } else if ("state".equals(evt.getPropertyName())) {
                         if (SwingWorker.StateValue.DONE == evt.getNewValue()) {
                             progress.setIndeterminate(true);
            loader.execute();
    abstract class IIOReadProgressAdapter implements IIOReadProgressListener {
        @Override public void imageComplete(ImageReader source) {}
        @Override public void imageProgress(ImageReader source, float percentageDone) {}
        @Override public void imageStarted(ImageReader source, int imageIndex) {}
        @Override public void readAborted(ImageReader source) {}
        @Override public void sequenceComplete(ImageReader source) {}
        @Override public void sequenceStarted(ImageReader source, int minIndex) {}
        @Override public void thumbnailComplete(ImageReader source) {}
        @Override public void thumbnailProgress(ImageReader source, float percentageDone) {}
        @Override public void thumbnailStarted(ImageReader source, int imageIndex, int thumbnailIndex) {}
    }

  • Java Applet fails loading JAR files

    I'm using the OC4J setup with my Oracle forms (10g) install, this was working but no longer.
    I get the message below when running the test.fmx from the Oracle Forms Services test page for each of the JAR files attempting to load.
    I comment out the ARCHIVE statement but it still fails with
    'java.lang.ClassNotFoundException:oracle.forms.engine.Main' on the applet window.
    =====================
    java.io.IOException: Connection failure with 504
         at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source)
         at oracle.jre.protocol.jar.HttpUtils.followRedirects(Unknown Source)
         at oracle.jre.protocol.jar.JarCache$CachedJarLoader.isUpToDate(Unknown Source)
         at oracle.jre.protocol.jar.JarCache$CachedJarLoader.loadFromCache(Unknown Source)
         at oracle.jre.protocol.jar.JarCache$CachedJarLoader.load(Unknown Source)
         at oracle.jre.protocol.jar.JarCache.get(Unknown Source)
         at oracle.jre.protocol.jar.CachedJarURLConnection.connect(Unknown Source)
         at oracle.jre.protocol.jar.CachedJarURLConnection.getJarFile(Unknown Source)
         at sun.misc.URLClassPath$JarLoader.getJarFile(Unknown Source)
         at sun.misc.URLClassPath$JarLoader.<init>(Unknown Source)
         at sun.misc.URLClassPath$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.misc.URLClassPath.getLoader(Unknown Source)
         at sun.misc.URLClassPath.getLoader(Unknown Source)
         at sun.misc.URLClassPath.getResource(Unknown Source)
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    WARNING: error reading http://nzmdgrenfell01.asiapacific.hpqcorp.net:8889/forms/java/frmwebutil.jar from JAR cache.
    Downloading http://nzmdgrenfell01.asiapacific.hpqcorp.net:8889/forms/java/frmwebutil.jar to JAR cache
    java.io.IOException: Connection failure with 504
    Any suggestions?
    Regards......Derek

    I found this Metalink that solved my problem.
    Note:171159.1

  • Access jar file from in-memory classes...

    I have some classes that I compile to memory and everything works fine until one class that must access some external jar files. I have been unable to access those jar files from disk after trying every suggestion using URLClassLoader. I even tried someone's example to hack the SystemClassLoader which properly adds the jar file paths, but still they can't be seen. The only way it works is if I put the files in the jdk/jre/lib/ext directory. Then everything works fine. There must be a way to load the jar files in memory as well as the class files so they can be accessible. Has anyone done anything like this? Is it possible? Even though the class files are in memory, why would the jar files not be seen even when they are added to the same URLClassLoader's URL's. Thanks.

    Sorry that wasn't clear. What I mean is that the classes are compiled to byte code directly to memory and no physical .class file is created. Yes, I'm using my own ClassLoader that extends URLClassLoader and I'm setting the parent to ClassLoader.getSystemClassLoader(). I also should mention that I'm doing this inside a Netbeans module that is part of a Netbeans Platform application. I don't know why that should matter though, since I'm trying to do everything in memory without creating the physical files. Thanks.

  • How to access jar files

    Hello,
    I've created a web application using servlets and jsp.
    Under Tomcat/webapps dir, I created my project dir and copied jsp files there, whereas copied all the java and class files under webapps/projectdir/WEB-INF/classes/mypackage. I also created a web.xml file under WEB-INF dir with my servlets mapping. I aslo created a lib dir under WEB-INF and copied jstl.jar and standard.jar in there. So far my application runs fine.
    Now I've to include some jar files that will be providing data from the backend to my servlet. I can't have .class files instead of .jar files, that is the restriction the way the backend files are built.
    Can anyone tell me how to make Tomcat access those jar files.
    Thanks.

    Ok then. I think the page you should read is [Tomcat 5 classloader documentation|http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html], though they simplified the structure in [Tomcat 6|http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html].
    Normally the classpath of a web application is restricted to
    - WEB-INF/classes directory
    - jar files in WEB-INF/lib
    - jar files in the server /lib directory.
    So if you have a common library that is used by multiple web applications, you could give each web-app their own individual copy of that library in WEB-INF/lib, or you could have them all use the same one in the server lib directory. There are pros and cons to both approaches.
    Cheers,
    evnafets

  • Applet that archieve jar file fail to load picture

    hello...
    i already can display my applet , but the ploblem is the applet canot display the picture...
    the class that i include in the jar file is can run and will display the picture...
    wat is the ploblem?
    thanks...

    This is my full code
    package dir.yew;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    import java.applet.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import javax.swing.event.*;
    public class DirTree
         extends JPanel {
         public static final String APP_NAME = "Directories Tree";
         public static final ImageIcon ICON_COMPUTER =
              new ImageIcon("computer.gif");
         public static final ImageIcon ICON_DISK =
              new ImageIcon("disk.gif");
         public static final ImageIcon ICON_FOLDER =
              new ImageIcon("folder.gif");
         public static final ImageIcon ICON_EXPANDEDFOLDER =
              new ImageIcon("expandedfolder.gif");
         protected JTree  m_tree;
         protected DefaultTreeModel m_model;
         protected JTextField m_display;
         public DirTree() {
              DefaultMutableTreeNode top = new DefaultMutableTreeNode(
                   new IconData(ICON_COMPUTER, null, "My Computer"));
              DefaultMutableTreeNode node;
              File[] roots = File.listRoots();
              for (int k=0; k<roots.length; k++) {
                   node = new DefaultMutableTreeNode(new IconData(ICON_DISK,
                        null, new FileNode(roots[k])));
                   top.add(node);
                node.add( new DefaultMutableTreeNode(new Boolean(true)));
              m_model = new DefaultTreeModel(top);
              m_tree = new JTree(m_model);
              m_tree.putClientProperty("JTree.lineStyle", "Angled");
              IconCellRenderer renderer = new
                   IconCellRenderer();
              m_tree.setCellRenderer(renderer);
              m_tree.addTreeExpansionListener(new
                   DirExpansionListener());
              m_tree.addTreeSelectionListener(new
                   DirSelectionListener());
              m_tree.getSelectionModel().setSelectionMode(
                   TreeSelectionModel.SINGLE_TREE_SELECTION);
              m_tree.setShowsRootHandles(true);
              m_tree.setEditable(false);
                   JScrollPane splitPane = new JScrollPane(
              new JScrollPane(m_tree)
              setLayout( new BorderLayout() );
              add( splitPane );
         DefaultMutableTreeNode getTreeNode(TreePath path) {
              return (DefaultMutableTreeNode)(path.getLastPathComponent());
         FileNode getFileNode(DefaultMutableTreeNode node) {
              if (node == null)
                   return null;
              Object obj = node.getUserObject();
              if (obj instanceof IconData)
                   obj = ((IconData)obj).getObject();
              if (obj instanceof FileNode)
                   return (FileNode)obj;
              else
                   return null;
           class DirExpansionListener implements TreeExpansionListener {
            public void treeExpanded(TreeExpansionEvent event) {
                final DefaultMutableTreeNode node = getTreeNode(
                    event.getPath());
                final FileNode fnode = getFileNode(node);
                Thread runner = new Thread() {
                        public void run() {
                             if (fnode != null && fnode.expand(node)) {
                                  Runnable runnable = new Runnable() {
                                       public void run() {
                                            m_model.reload(node);
                                  SwingUtilities.invokeLater(runnable);
                runner.start();
            public void treeCollapsed(TreeExpansionEvent event) {}
         class DirSelectionListener
              implements TreeSelectionListener {
              public void valueChanged(TreeSelectionEvent event) {
                   DefaultMutableTreeNode node = getTreeNode(
                        event.getPath());
                   FileNode fnode = getFileNode(node);
                   if (fnode != null)
                        m_display.setText(fnode.getFile().
                             getAbsolutePath());
                   else
                        m_display.setText("");
         public static void main(String argv[]) {
              JFrame frame= new JFrame( "FileSystem Viewer");
              DirTree dir = new DirTree();
              frame.getContentPane().add(dir);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.pack();
              frame.setVisible(true);
    class IconCellRenderer
         extends    DefaultTreeCellRenderer {
         public IconCellRenderer() {
              setLeafIcon(null);
              setOpenIcon(null);
         public Component getTreeCellRendererComponent(JTree tree,
              Object value, boolean sel, boolean expanded, boolean leaf,
              int row, boolean hasFocus) {
              // Invoke default implementation
              Component result = super.getTreeCellRendererComponent(tree,
                   value, sel, expanded, leaf, row, hasFocus);
              DefaultMutableTreeNode node =
                   (DefaultMutableTreeNode)value;
              Object obj = node.getUserObject();
              setText(obj.toString());
            if (obj instanceof Boolean)
                   setText("Retrieving data...");
              if (obj instanceof IconData) {
                   IconData idata = (IconData)obj;
                   if (expanded)
                        setIcon(idata.getExpandedIcon());
                   else
                        setIcon(idata.getIcon());
              else
                   setIcon(null);
              return result;
    class IconData {
         protected Icon   m_icon;
         protected Icon   m_expandedIcon;
         protected Object m_data;
         public IconData(Icon icon, Object data) {
              m_icon = icon;
              m_expandedIcon = null;
              m_data = data;
         public IconData(Icon icon, Icon expandedIcon, Object data) {
              m_icon = icon;
              m_expandedIcon = expandedIcon;
              m_data = data;
         public Icon getIcon() {
              return m_icon;
         public Icon getExpandedIcon() {
              return m_expandedIcon!=null ? m_expandedIcon : m_icon;
         public Object getObject() {
              return m_data;
         public String toString() {
              return m_data.toString();
    class FileNode {
         protected File m_file;
         public FileNode(File file) {
              m_file = file;
         public File getFile() {
              return m_file;
         public String toString() {
              return m_file.getName().length() > 0 ? m_file.getName() :
                   m_file.getPath();
         // Alternatively we copud sub-class TreeNode
         public boolean expand(DefaultMutableTreeNode parent) {
              DefaultMutableTreeNode flag =
                   (DefaultMutableTreeNode)parent.getFirstChild();
              if (flag==null)       // No flag
                   return false;
              Object obj = flag.getUserObject();
              if (!(obj instanceof Boolean))
                   return false;      // Already expanded
              parent.removeAllChildren();  // Remove Flag
              File[] files = listFiles();
              if (files == null)
                   return true;
              Vector v = new Vector();
              for (int k=0; k<files.length; k++) {
                   File f = files[k];
                   if (!(f.isDirectory()))
                        continue;
                   FileNode newNode = new FileNode(f);
                   boolean isAdded = false;
                   for (int i=0; i<v.size(); i++) {
                        FileNode nd = (FileNode)v.elementAt(i);
                        if (newNode.compareTo(nd) < 0) {
                             v.insertElementAt(newNode, i);
                             isAdded = true;
                             break;
                   if (!isAdded)
                        v.addElement(newNode);
              for (int i=0; i<v.size(); i++) {
                   FileNode nd = (FileNode)v.elementAt(i);
                   IconData idata = new IconData(DirTree.ICON_FOLDER,
                        DirTree.ICON_EXPANDEDFOLDER, nd);
                   DefaultMutableTreeNode node = new
                        DefaultMutableTreeNode(idata);
                   parent.add(node);
                   if (nd.hasSubDirs())
                        node.add(new DefaultMutableTreeNode(
                             new Boolean(true) ));
              return true;
         public boolean hasSubDirs() {
              File[] files = listFiles();
              if (files == null)
                   return false;
              for (int k=0; k<files.length; k++) {
                   if (files[k].isDirectory())
                        return true;
              return false;
         public int compareTo(FileNode toCompare) {
              return  m_file.getName().compareToIgnoreCase(
                   toCompare.m_file.getName() );
         protected File[] listFiles() {
              if (!m_file.isDirectory())
                   return null;
              try {
                   return m_file.listFiles();
              catch (Exception ex) {
                   JOptionPane.showMessageDialog(null,
                        "Error reading directory "+m_file.getAbsolutePath(),
                        DirTree.APP_NAME, JOptionPane.WARNING_MESSAGE);
                   return null;
    }

  • Signed applet : problem signing jar files that are in build path

    Hello,
    I have a problem while trying to create an ftp applet.
    I use org.apache.commons.net.ftp and i build path for commons-net-1.1.4.jar and then i build my classes.
    When i create a jar file with my classes and after signing it, it works under eclipse but not on a web page.
    I had signed commons-net-1.1.4.jar before to build the path in eclipse but commons-net-1.1.4.jar is not in my jar file.
    What is the way to sign applet correctly even if some jar ressources are in eclipse build path.
    Thank you

    You were right!!!
    I'm not sure what to write down in the formsweb.cfg (configuration file) , following the instructions on the on-line help of Developer Forms 10g , in step 9..
    The step 9 says...
    Because in this release the JACOB code is in an external Jar file and not incorporated into frmwebutil.jar, it needs to be downloaded. To do this, change the WebUtilArchive setting to read: webUtilArchive=/forms/webutil/frmwebutil.jar,/forms/webutil/jacob.jar
    The doudt is pointed to the fact that the frmwebutil.jar isn't in the ORACLE_HOME\forms\webutil path but it is ORACLE_HOME\forms\java path.
    Also , these paths referenced in webUtilArchive are physical paths in a Unix system or they are logical paths in a url?
    Simon

  • How the applet can access local file system?

    1. I want to plugin the applet into the JSP. That applet should access the local file system. How to enable this programmatically.
    2. Is it is possible to embed a frame inside the JSP. If so how?
    Thanks in advance..
    K G Vinoth

    1: If you want the applet to access the client's local file system you'll have to sign the applet. There is a tutorial some where on the java.sun.com that explains how to sign an applet.
    2: No you;ll need to use an applet to display swing or awt components on the client browser.

  • Accessing JAR file

    How i can access a file inside my JAR? Anybody there to help me?

    Touchy subject.
    Look in the [java.util.jar|http://java.sun.com/j2se/1.4.2/docs/api/java/util/jar/package-summary.html] package to get ideas. You might also want to check google for "java unpack jar" and use that to read files.

Maybe you are looking for

  • Every video put into Final Cut Pro exports in horrible quality regardless of format/settings.

    Hello fellow Mac enthusiasts, I'm having a problem which may or may not have been plaguing my studio since day one. Every video that we edit in Final Cut Pro exports in MUCH lower quality than it was when it was imported, not only that, the file size

  • Samsung Note 3 erasing contact info for random contacts - not all contacts.

    My Samsung Galaxy Note 3 has begun dropping contacts from my phone list.  I will receive a text from a phone number and realize it is someone who was in my Favorite List and is now removed from contact list completely. Today three people that I call,

  • Ship-to party vs. delivery address

    Dear All, We have the following conditions sold-to party - Italy ship-to party - UK (distribution) We should deliver our FGs into UK, but they (UK) requested us to deliver the goods directly to end users into Austria. What shall we do with SO? Shall

  • TS1369 ipod appears in iTunes, but not in windows explorer?

    So my iPod appears in iTunes just fine, i can sync it and everything, but when i want to move my photos over, my iPod never shows up in windows explorer anymore. All the support tutorials are for if your iPod shows up in windows explorer and not itun

  • Upgrade to CS6 ME

    I have InDesign CS3 Middle Eastern version. I want to upgrade to CS6 ME. I live in Europe. Where should I request the upgrade, so that I am sure I download the ME version?