GIf and Jar files

I want to put all image files used one of my programs in jar file(let's say "images.jar") so how can can I get the images file if the class who needs them is not in "images.jar'
can I do like that ?
JButton b=new JButton("OK");
b.setIcon(new ImageIcon("image.jar/ok..gif"));

Make sure the jar-file is in the classpath.... then ude getResource() or getResourceAsStream() to get hold of them.
/Michael

Similar Messages

  • Are JDev autogenerated paths needed to create ear, war and jar files ?

    Hi
    We want to create ear, war and jar files from Ant build script generated from JDeveloper 11.1.1.7.
    We also like to use ojdeploy with it.
    In the process of creating build.xml files from projects, we see these paths.
    We also have standalone Weblogic installed with ADF runtime 11.1.1.7
    Questions:
    1- Do we need these path ids to generate ear, jar, war files properly and then deploy the ear to our standalone Weblogic so that our webapp can run ok ?
    2- Why are they generated, if they are not needed
    From research, it appears that we don't need these paths except to keep ant targets of init, compile, exec etc with ojdeploy.
    3- Is that true ?
    We are afraid that because no paths are listed in the build.xml, then when we deploy the ear app, it cant use the ADF runtime on the standalone WLS.
    Thanks in advance for answering.
    Sincerely
    eg of paths generated below:
      <path id="library.SOA.Designtime"/>
      <path id="library.SOA.Runtime"/>
      <path id="library.BPEL.Runtime"/>
      <path id="library.Mediator.Runtime"/>
      <path id="library.MDS.Runtime">
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.mds_11.1.1/mdsrt.jar"/>
      </path>
      <path id="library.BC4J.Service.Runtime">
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.adf.model_11.1.1/adfbcsvc.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.adf.model_11.1.1/adfbcsvc-share.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/commonj.sdo_2.1.0.jar"/>
        <pathelement location="{oracle.middleware}/modules/org.eclipse.persistence_1.1.0.0_2-1.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.webservices_11.1.1/wsclient.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.web-common_11.1.1.jar"/>
      </path>
      <path id="library.TopLink">
        <pathelement location="{oracle.middleware}/modules/com.oracle.toplink_1.0.0.0_11-1-1-5-0.jar"/>
        <pathelement location="{oracle.middleware}/modules/org.eclipse.persistence_1.1.0.0_2-1.jar"/>
        <pathelement location="{oracle.middleware}/modules/com.bea.core.antlr.runtime_2.7.7.jar"/>
        <pathelement location="{oracle.middleware}/modules/javax.persistence_1.0.0.0_2-0-0.jar"/>
      </path>
      <path id="library.Oracle.Rules"/>
      <path id="classpath">
        <path refid="library.SOA.Designtime"/>
        <path refid="library.SOA.Runtime"/>
        <path refid="library.BPEL.Runtime"/>
        <path refid="library.Mediator.Runtime"/>
        <path refid="library.MDS.Runtime"/>
        <path refid="library.BC4J.Service.Runtime"/>
        <path refid="library.TopLink"/>
        <path refid="library.Oracle.Rules"/>
      </path>

    There are two different things here. Using ant to build the class files and then building an ear from the class files and other resources.
    The building part needs the libraries if you use javac as compiler. Building an ear file only needs the path to the jar files which are packed into the ear.
    In this sense you need the pages you see in the build.xml.
    Then Jdev offers another way: ojdeploy. This tool is a Jdev without a gui.
    You can use this tool and build the classes for each project of a workspace and to build build war and ear file. This is just like you click the rebuild button for each project and then the deploy the projects and application. If you use this approach you don't need the generated path ids as the whole build process is done inside Jdev as it's done on your developer pc.
    Timo

  • Where to put common classes and jar files

    hi,
    i want to put some classes and jar files in a common folder so that it can be accessed by other applications is there any way doing that.In tomcat server they have common and shared directories once any classes are into that folder they are being accessed easily ,but i am having problems with sun one .
    Regards
    Ameem Sami

    Did you find a solution for this? I'm having the same problem.
    Thanks,
    Tony

  • Bridge: why can't I add any metadata to gif and pct files???

    Not sure what the issue is here with Adobe Bridge and gif and pct files, but Bridge won't let me add any metadata or keywords.
    With keywords, Bridge displays a window saying that pct and gif files can't add xmp metadata.
    Is there something I'm missing in my settings? Or should I just go ahead and convert all my gif and pct files to jpegs, tiffs or psd.

    Not sure what the issue is here with Adobe Bridge and gif and pct files, but Bridge won't let me add any metadata or keywords.
    With keywords, Bridge displays a window saying that pct and gif files can't add xmp metadata.
    Is there something I'm missing in my settings? Or should I just go ahead and convert all my gif and pct files to jpegs, tiffs or psd.

  • Protecting jnlp and jar files

    Hi
    I would like to know how to protect the jnlp and jar files against anyone who just types the URL in the browser Address bar.
    Thanks
    Steven

    Haven't tried, but if your jnlp app must check for updates on every startup and your files (both jnlp file and jars) are in a password protected folder (using digest or plain authentication over a SSL connection, for example) then you may be in trouble. Will JWS recognize this situation on an update check and prompt for login/password? (related to web server's folders).
    Regards

  • [svn:bz-trunk] 19596: Add JGroups 2.11.0 GA source and jar files.

    Revision: 19596
    Revision: 19596
    Author:   [email protected]
    Date:     2011-01-05 08:35:22 -0800 (Wed, 05 Jan 2011)
    Log Message:
    Add JGroups 2.11.0 GA source and jar files.  It requires JDK 1.6.x and up.   Currently it can be only used for runtime and can't be used to build the BlazeDS source, which requires JDK 1.5.x.
    Modified Paths:
        blazeds/trunk/resources/clustering/readme.txt
    Added Paths:
        blazeds/trunk/lib/jgroups-2.11.0.GA.jar
        blazeds/trunk/resources/clustering/JGroups-2.11.0.GA.src.zip

    Revision: 19596
    Revision: 19596
    Author:   [email protected]
    Date:     2011-01-05 08:35:22 -0800 (Wed, 05 Jan 2011)
    Log Message:
    Add JGroups 2.11.0 GA source and jar files.  It requires JDK 1.6.x and up.   Currently it can be only used for runtime and can't be used to build the BlazeDS source, which requires JDK 1.5.x.
    Modified Paths:
        blazeds/trunk/resources/clustering/readme.txt
    Added Paths:
        blazeds/trunk/lib/jgroups-2.11.0.GA.jar
        blazeds/trunk/resources/clustering/JGroups-2.11.0.GA.src.zip

  • How to run .class file and .jar file in jdev9i

    I want to run .class file and .jar file in jdev9i,what should I do?
    Also,I want to generate .class file and .jar file in jdev9i,what should i do?

    Add the .class file containing the public static void main(...) method to the project by clicking on the + toolbar button in the navigator, open the project properties and properly set the additional classpath then right click on the .class in the navigator and say run. It should work, I've just tried it.
    Doesn't work for a .jar yet, in JDeveloper 9.0.3 it works both for .class and .jar
    Michel

  • Java Plugin and GIFs from Jar file...

    This used to work and I haven't looked at it for a while. First thing I did is run the old java applet web page with the old jar file, kinda just to lay eyes on the thing again.
    It had to download a new plug-in from Sun, and upon doing so, reports a new error indicating that the value for the cache_version attribute in the HTML is incorrect. It was 1.0 (always has been) and the plugin says it needs to be in X.X.X.X format instead.
    So, that isn't a nice change to make in the plugin at this time. However, if I just click okay and close the error dialog, at least it works fine after that.
    In my attempt to get rid of the dialog I change the cache version to 1.0.0.0, upon doing this
    the toolbar images no longer load, it says there is a java.io.FilePermission error.
    We'll it doesn't make any sense that a mere change to cache version caused that so I changed the version back to the apparently erroneous value of 1.0, and then the toolbar images work again ! But I get the permission error.
    Any ideas how I can fix these pesky images loading from a jar ?
    Do you have any code that loads images out of a jar in an applet succesfully ?
    Or have any suggestions on what I could try ?
    Below is the code I'm using to load the images, where icoXXXX is a ImageIcon object, and fileameXXXX is a string containing a relative file path such as "images/highcolor/toc_color.gif" (this code executes in the applet's init() method (called by the plugin):
    java.net.URL urlToc = getClass().getResource(filenameToc);
    java.net.URL urlTocBW= getClass().getResource(filenameTocBW);

    dunno why but
    getClass().$blah... wouldn't work for getting images in an applet from a jar for me.
    But this does:
    Class c = Class.forName("java.lang.Object");
    InputStream in = c.getResourceAsStream("/images/myImage.gif");
    byte[] buffer = new byte[in.available()];
    in.read(buffer);
    icon = new ImageIcon(buffer);
    when included with the usual default exception handling.
    Lemme know if that doesn't work for you.
    cheers
    -Ragu
    Overweight is when you step on your dog's tail and it dies.

  • Form 11g and Jar file issue

    I have migrated all the forms from 10g to 11g. When i run the form 11g using my config i get the below error
    USING Java Plug-in 1.6.0_23 i get the below error
    java.lang.SecurityException: class "oracle.forms.demos.enhancedItems.InfoButton"'s signer information does not match signer information of other classes in the same package
         at java.lang.ClassLoader.checkCerts(Unknown Source)
         at java.lang.ClassLoader.preDefineClass(Unknown Source)
         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.access$000(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 java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at oracle.forms.handler.UICommon.instantiate(Unknown Source)
         at oracle.forms.handler.UICommon.onCreate(Unknown Source)
         at oracle.forms.handler.ButtonItem.onCreate(Unknown Source)
         at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
         at oracle.forms.engine.Runform.processMessage(Unknown Source)
         at oracle.forms.engine.Runform.processSet(Unknown Source)
         at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
         at oracle.forms.engine.Runform.onMessage(Unknown Source)
         at oracle.forms.engine.Runform.processEventEnd(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    I tried using the Java Plug-in 1.6.0_12
    Loaded image: jar:http://130.1.3.171:9001/forms/java/frmall.jar!/oracle/forms/icons/bgnd.gif
    Forms Session ID is formsapp.9
    The proxy host is null, and the proxy port is 0.
    Native HTTP implementation is being used for the connection.
    The connection mode is HTTP.
    Forms Applet version is 11.1.1.4
    Loaded image: jar:http://130.1.3.171:9001/forms/java/frmall.jar!/oracle/forms/icons/frame.gif
    Exception "java.lang.IllegalArgumentException: failed to parse:"while constructing DataFlavor for:
    Exception "java.lang.IllegalArgumentException: failed to parse:"while constructing DataFlavor for:
    java.lang.ClassNotFoundException: oracle.forms.demos.enhancedItems.InfoButton
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at oracle.forms.handler.UICommon.instantiate(Unknown Source)
         at oracle.forms.handler.UICommon.onCreate(Unknown Source)
         at oracle.forms.handler.ButtonItem.onCreate(Unknown Source)
         at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
         at oracle.forms.engine.Runform.processMessage(Unknown Source)
         at oracle.forms.engine.Runform.processSet(Unknown Source)
         at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
         at oracle.forms.engine.Runform.onMessage(Unknown Source)
         at oracle.forms.engine.Runform.processEventEnd(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed:http://130.1.3.171:9001/forms/java/oracle/forms/demos/enhancedItems/InfoButton.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)
         ... 35 more
    My config section is
    [form11g]
    jpi_download_page=http://java.sun.com/products/archive/j2se/6u12/index.html
    jpi_classid=clsid:CAFEEFAC-0016-0000-0012-ABCDEFFEDCBA
    jpi_codebase=http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab#Version=1,6,0,12
    jpi_mimetype=application/x-java-applet;jpi-version=1.6.0_12
    archive=frmall.jar,modcursor.jar,Images.jar,keyfilter.jar,ticker.jar,rolloverbutton.jar,activation.jar,javamailintegration.jar,mail.jar,uploadserver.jar,uploadclient.jar,infobutton.jar,hyperlink.jar,colorpicker.jar
    form=login.fmx
    pageTitle=Oracle Application
    splashScreen=No
    Previously i used to use jinitiator for 10g. Is there any configuration need to be done or should i sign the jar files.

    You might want to use google:
    http://www.google.com/#q=signer+information+does+not+match+signer+information+of+other+classes+in+the+same+package
    cheers

  • Problem in bundling gifs in jar file.

    Hello all,
    I am having following package structure.
    /* For example */
    com.course.explorer;
    com.course.explorer.toolbar;
    and an image directory having all images in
    com/course/explorer/images
    Now to associate an ImageIcon with a button in toolbar package.
    /* for example */
    code from NewCourseBut.java present in com.course.explorer.toolbar package.
    ImageIcon img = new ImageIcon(
    getClass().getResource("../images/new_course.gif"));
    Now my problem is when I am trying to run a jar file (containing all my code+images) it throws NullPointerException.( Unable to find the image new_course.gif)
    I am not able to understand wher I am going wrong.
    Can anyone please help me out in finding my fault.
    Smiles,

    Hello All,
    Is there any standard way of incorporating gifs in an Jar file.
    Consider that one is extracting an ImageIcon for a Toolbar button and for the same the gifs is present in an "images" directory.
    I did tried alot of permutation & combinations still no luck.
    How one need to proceed for same ?
    Any guidance is welcome.
    Smiles,

  • Gifs in jar files

    I have an application that uses some gif files which are displayed using the ImageIcon object. How do i get it so that it can find the gifs within the jar file that the application is packaged in?
    Greg

    hi,
    a jar-file is to use like a directory and with the command 'getClass().getResource()' you get the real directory to your pictures (or other ressources).
    ex.
    your jar-file contains the following:
    /yourLib/YourClass.class
    /yourLib/img/pic1.gif
    then you can get the pic from your class 'YourClass.class' with the command
    ....setIcon(new javax.swing.ImageIcon(getClass().getResource("/yourLib/img/pic1.gif")));
    cu
    oliver scorp

  • Program for turning animated .gif and MP3 files to .mov

    I need a program that takes an animated GIF and an MP3 of WAV file and turns them into a .mov file, but I don't have the money for FinalCut. Is there a cheaper (or free) program that can do this thing?

    hello. try mpeg streamclip here -
    http://www.apple.com/downloads/macosx/video/mpegstreamclip.html
    not sure if it'll help, but most users here swear by it for various format conversions. and it's free.

  • The system doesn´t let me change the dock and .jar files

    Dear professionals,
    since a couple of days I come across with a weird problem:
    I am logged in as admin but the system doesn`t perform several modifications:
    such as:
    if I remove a broken link from the dock (grey questionmark) and replace it with a new link to the new app the next session everything is unchanged and the questionmark is back.
    if I want firefox not to play quicktime and try to change the preferences it flips back immediately
    if I want to open Cocktail to schek something it does not accept me as admin - whereas the systems calls me admin.
    maybe the futile attempt to alter the minecraft.jar has the same reason.
    At many files the file info shows a strange entry at the botten where the sharing/permission are listed: Name is "Laden..." meanig "Loading..." with the dots and as symbol a grey person with tiny questionmark; permission is "read only"
    History:
    Till now I never used a password and logged in automatical as admin
    I upgraded to Lion
    I installed a second account to have a workspace not as admin
    I gave a password to the admin account
    I got nuts with the second account as I couldn´t change the preferences of firefox and delete files and so on
    I gave administration rights to the second account to customize the workspace
    I realized the problems with the admin account - changes where ignored/forgotten by the system w/o warnings
    I deleted the second account as it seemed to cause the trouble
    I repaired the rights in the admin account
    I repaired the HD with HD recovery
    I try to check the system with cocktail but cocktail tells me the password is not sufficient - it opens the app but it refuses any modifications
    I switched to manual login
    System tells me that the keychain.login does not accept the password
    I set the password for keychain also
    keychain first aid tells me the password does not work ?
    I removed the password from admin account
    I removed the password from keychain first aid is happy
    Repair rights does not find any trouble
    Cocktail does not accept me anyway anymore, without password (as i logged in) or the former passwords- it blocks at all.
    And all the other stuff listed at the beginning drives me crazy
    File Info window tells me i have adapted rights- whatever it means, as i am listed with full read/write rights
    now I am stunned.
    I would like to use my Installation disk to repair anything - but as it is not the lion system I am afraid to cause more trouble.
    Does anyone have a clue?
    And sorry for the strange text- english is not my native language
    And, btw, is netinfo manager removed by lion? it does not appear on my volume.
    Thanks for Your help
    Bernhard

    Repairing the permissions of a home folder in Lion is a complicated procedure. I don’t know of a simpler one that always works.
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the page that opens.
    Drag or copy – do not type – the following line into the Terminal window, then press return:
    chmod -R -N ~
    The command will take a noticeable amount of time to run. When a new line ending in a dollar sign ($) appears below what you entered, it’s done. You may see a few error messages about an “invalid argument” while the command is running. You can ignore those. If you get an error message with the words “Permission denied,” enter this:
    sudo !!
    You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up.
    Next, boot from your recovery partition by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the recovery desktop appears, select Utilities ▹ Terminal from the menu bar.
    In the Terminal window, enter “resetpassword” (without the quotes) and press return. A Reset Password window opens.
    Select your boot volume if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select  ▹ Restart from the menu bar.

  • How to use packages and jar files for applet?

    Hi!
    My applet takes a class say a.class.
    Now this class depends on other classes that are packaged
    in a directory and put separately.
    I want to put this applet on the web.
    So how do I manage the .class files in he package.
    I have tried using jar file format.But I was not able to get it working.
    Can someone please help me?
    Thanks

    Use Archive instead of codebase:
    <APPLET CODE="MyApplet.class" ARCHIVE="MyApplet.jar" WIDTH=400 HEIGHT=300></APPLET>

  • Classpath and jar file question

    my application need to use few jar files i downloaded from the internet
    so i need to set the classpath so that i can import the packages in the jar file rite?
    let say set classpath=.;c:\somedir\bin;
    the ".;" after the "=" means that i search the current directory first then search the directory i have specified after that rite?
    if so, can i put all the needed jar files in the current directory so that my application can use them??
    Another question is if all the jar files in located in the same directory how can i set the class path to refer to them without sepecifying each of the jar file name??can i just put the directory path and will it locate them automatically when my application start??
    can anyone tell me about it??thanks

    No, you need to include each and every jar file in your classpath.
    Or put them all in your <jdk_installation_dir>\jre\lib\ext directory, so that they will get included in your classpath automatically.
    Sudha

Maybe you are looking for