How can I add image files to a executable jar file ?

Could you tell me how can I add image files to executable jar file ?
package structure:
../com/Main.class
../images/..

Please don't cross post, and read this
http://forum.java.sun.com/thread.jsp?forum=31&thread=271751
I've answered the question in the New To Java thread.

Similar Messages

  • How can I add links to open xml and csv files stored in another location? Please advice how to place links in my frame maker document?

    Hi,
    I would like to know as to how can I add links to open xml and csv files stored in another location? Please advice how to place links in my frame maker document?
    Kindly advice.
    Thanks
    Priya

    Special > Hypertext > Command "open document" will do its best to open the target document inside FrameMaker, which may not be much help; Special > Hypertext > Command "message …" will use the application you specify. The user guide for 7.0 says this about absolute links, and I don't think anything has changed since:
    For example, to start PaintBrush and open the Ship.pcx file on drive C you would use the command message system pbrush.exe C:/Ship.pcx
    I've not often used a relative link, and not recently: the same source says
    folder levels are separated by a slash / even in Windows and Mac
    [relative links] FrameMaker searches for a relative pathname beginning in the folder that contains the current document
    [absolute links] FrameMaker searches for an absolute pathname beginning at the top of the file system. In Windows, the absolute pathname begins with the drive specifier, a colon and a slash.

  • How can i add image on my mail siganature on iphone

    hi,
           how can i add image on my mail siganature on iphone.

    I do not know if this will work but you can try. Place the image you want on a storage site like Imageshack or Photobucket. Then make a link to it in your signature using (img_src="put the url of your image here"). This may work at least when you have an active data connection - wifi or cellular

  • Including a jar file inside an executable jar file

    Is it possible to include a jar file inside another (executable) jar file such that the included file is part of the class path for the outer file? If so, how do you specify this in the classpath in the manifest?

    Russ_Bjork wrote:
    Is it possible to include a jar file inside another (executable) jar file such that the included file is part of the class path for the outer file?No. Actually, I suppose it would be possible if you do all the 'heavy lifting', but Java is not designed to handle Jars within Jars.
    What do you see as the advantage of doing that?
    Is your app. a rich client (e.g. Swing, AWT, SWT..)?
    Can you distribute the app. from a server or the internet?

  • Using the value "Image/*" for the accept attribute of the HTML input Element, how can I add .pdf to the array of preconfigured file types (.jpe, .jpg, .jpeg, .?

    On a form, using the value "image/*" for the accept attribute of the HTML input Element, how can I add .pdf to the array of pre-configured file types (.jpe, .jpg, .jpeg, .gif, .png, .bmp, .ico, .svg, .svgz, .tif, .tiff, .ai, .drw, .pct, .psp, .xcf, .psd, .raw)?
    Say I wanted to add .gif, .jfif or .ico. I find this array limited, how can I add types to image?
    <input type="file" name="file" accept="image/*" id="file" />
    mimeTypes.rdf does not seem to allow this.

    ''mimeTypes.rdf'' has nothing to do with web development. It's a file that stores your file handling preferences (e.g. if you want ZIP files automatically saved or opened).
    You can't change the file types of the pre-defined content specifiers (audio/*, video/*, image/*), but you can specify additional MIME types. To add PDF to your above example,
    <pre><nowiki><input type="file" name="file" accept="image/*,application/pdf" id="file" /></nowiki></pre>
    For details, see
    * [https://developer.mozilla.org/En/HTML/Element/Input developer.mozilla.org/En/HTML/Element/Input]

  • How can you add images and text to UIScrollBar Component

    I can only add the text, can't add images. Also how can you make paragraphs out of long text in a UIScrollBar?
    Thanks.

    Hi,
    UIScrollBar Component can be attached to a dynamic text filed and the text field can be set to Render Text as HTML option which in turn can display both text & images(using <img> tags).
    Refer http://www.flashvalley.com/fv_tutorials/loading_HTML_in_a_dynamic_text_field/page2.php that may help you getting what do you want
    Thanks!

  • How can i add or create Layers into existing PDF File

    How can i create or add new Layers into new or existing PDF file using DLE JAVA API (Datalogics API)

    sandyrock,
    The PDFL, as Adobe distributes it, only has a C/C++ interface.
    The JNI APIs are developed and supported by Datalogics, the company you licensed your copy of the PDFL from. Have you contacted them? Support for their API extensions to the PDFL should be included with your licensing fee and they have many tips and ready-made examples specific to their API extensions they could give you.

  • How can I add account privileges to a newly created file?

    I have multipe accounts on my Mac.  Two of them need to share certain files, but not with everyone else so I can't use the Shared folder.  When I create a new text file with AppleScript it has default ownership to the account that created it, but I need to give read & write privilages to it to the other account as well.  I can do this manually, but there are lots of files sometimes.  One trick I've found is to reset privilages from the next higher folder.  This saves time, but sometimes I forget.  Also when I do this it causes Time Machine to think all the files in that folder have been updated.  If the folder is large it may cause Time Machine to purge a old backup version.  What I'd like to do is find some AppleScript code I can use to add user "A" with read & write access to the permissions of a new file at the time my AppleScript creates that file.  Any ideas?

    Thanks for the reference.  It was interesting and provided me with a direction I hadn't thought of: User Groups and Terminal commands which led to DO SHELL SCRIPT.
    The approach in your reference wasn't practical for me because I already have about 10,000 folders in a 4-deep tree structure on a 2 TB hard disk.  The inheritance method whould have taken a lot of work.
    I did some more researching and experimentation and here's what I ended up with.
    First I created a User Group and assigned the two accounts that needed to share files to it.  By the way, I have two accounts so I can run time-consuming AppleScripts in one while doing work in the other.  This way I'm not disturbed by the AppleScripts and, since some of them use System Events, they aren't disturbed by me.  Anyway, I set up a User Group.  For some reason, the first group didn't work properly.  When I assigned it to a folder or file, one of the account names appeared next to the group icon in the Get Info window of Finder.  I tried everything I could think of to make it work and failed.  Then I created a second User Group and it worked fine, so I just deleted the first group.  I wonder what went wrong the first time?
    Next I used the Finder's Get Info window to apply the new Group privilages to all items in my very large shared data folder on that hard drive.  This took about an hour.
    Finally I created the following AppleScript code taking most of it from what I found on the Internet and fixing problems using other things found on the net.  I've built the following code into a number of AppleScripts that create folders containing 20-200 files.  I've run two of the scripts and created about 200 files in a few dozen folders and it seems to work fine.  Oh, one more thing: For some reason I couldn't assign group membership by name.  I kept getting an error message.  When I substitued the group number - 505, it worked fine.  Go figure!
    tell application "Finder"
    ... lots of finder code ...
    set these_items to every item in folder (target_folder & folder_name)
    tell me
                                            set this_POSIX to quoted form of POSIX path of ((target_folder & folder_name) as alias)
                                            do shell script "chown -R  " & "Programming:505 " & this_POSIX user name "Richard" password "xxx" with administrator privileges
                                            do shell script "chmod -R 770 " & this_POSIX user name "Richard" password "xxx" with administrator privileges
                                            repeat with this_item in these_items
                                                      set this_POSIX to quoted form of POSIX path of (this_item as alias)
                                                      do shell script "chown -R  " & "Programming:505 " & this_POSIX user name "Richard" password "xxx" with administrator privileges
                                                      do shell script "chmod -R 770 " & this_POSIX user name "Richard" password "xxx" with administrator privileges
                                            end repeat
                                  end tell
    ...more finder code
    end tell
    Note: The tell me was recommended by someone on the net.  There was a caution about do shell script failing inside a Tell application "Finder".  I didn't test this.
    I'm a happy camper now.  I don't think I'd have found my way without the reference you provided.

  • How can I add ?xml-stylesheet to an XML file?

    Hi guys,
    I have a java code that writes out an XML file. I want to specify the name of a stylesheet in the XML file. How can I do that?
    This is the source code I have:
    //---------- Create XML File ------------------
    private void createXMLFile(Document doc) throws Exception
    try
    TransformerFactory tF = TransformerFactory.newInstance();
    Transformer tr = tF.newTransformer();
    FileOutputStream outXml = new FileOutputStream(xmlFile, false);
    tr.transform(new DOMSource(doc), new StreamResult(outXml));
    outXml.close();
    catch (java.io.FileNotFoundException exc)
    throw new Exception(exc.getMessage());
    catch( TransformerConfigurationException exc )
    throw new Exception(exc.getMessage());
    catch( TransformerException exc )
    throw new Exception(exc.getMessage());
    Thank you
    Murat

    The solution from dvohra09 will output a file outXml that uses the format rules from stylesheet.
    But how can I write out the following 2 lines to outXml? contextHandler.startDocument() will only write out the first line, but not the second line...
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="mytest.xsl"?>
    Thanks for all pointers!
    Philip

  • How can I add an expiration date to a pdf file?

    How can I apply an expiration date to a pdf document in Acrobat Pro X? Can this be done in Acrobat XI?

    Read this:
    http://forums.adobe.com/thread/1085319?tstart=0

  • How can i add Image or Picture Column to Matrix

    Hello Experts,
    I want to add Image or Picture column on my Add-on form matrix
    I am working on 8.81 PL5
    Please help out.
    Regards,
    Bhavank

    Hi Bhavank,
    Try This.....
          ocolumn = ocolumns.Add("CoGS", SAPbouiCOM.BoFormItemTypes.it_PICTURE)
            ocolumn.Editable = True
            ocolumn.Width = 60
            oitem.FromPane = 9
            oitem.ToPane = 9
            ocolumn.TitleObject.Caption = "COGSProfitCenter"
            ocolumn.DataBind.SetBound(True, "", "Folder")
            ouserdatasource = oOrderform.DataSources.UserDataSources.Item("Folder")
            omatrix.AddRow()
            omatrix.GetLineData(1)
            ouserdatasource.ValueEx = "c:\41224_128614427186464_128584050522835_146624_537710_s.jpg"
            omatrix.SetLineData(1)
    Thanks
    Shafi

  • How can I add random mail signatures from a text file?

    I'm trying to add a different quote to every email that I write... is there a program or way for Mail to pluck and append a quote at random from a external file of quotes?  (I'm not talking about the standard "Random" feature built into Mail.)
    There must be one out there, but I can't find it.  I'm using Snow Leopard and Mail 4.5

    Hello,
    Here is a running start on getting specific lines in the case lines starting with ComboBox. I took your data and placed it into a text file named TextFile1.txt in the bin\debug folder. Code below was done in
    a console app.
    using System;
    using System.IO;
    using System.Linq;
    namespace ConsoleApplication1
    internal class Program
    private static void Main(string[] args)
    var result =
    from T in File.ReadAllLines(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TextFile1.txt"))
    .Select((line, index) => new { Line = line, Index = index })
    .Where((s) => s.Line.StartsWith("ComboBox"))
    select T
    ).ToList();
    if (result.Count > 0)
    foreach (var item in result)
    Console.WriteLine("Line: {0} Data: {1}", item.Index, item.Line);
    Console.ReadLine();
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my webpage under my profile but do not reply to forum questions.

  • How can I add images which are not in Iphoto to Iweb photo gallery?

    I have many photos that I have not imported in Iphoto just because I worked on them with Photoshop and downloaded straight from the camera memory cards with a card reader. If I add the image from the disk with the add/choose command (or insert/choose: I have the italian version and I do not know what is the English original command...) the image is just attached to the screen but not inserted in the thumbnails of the gallery.
    Please help.
    Thanks
    Mauro
    Message was edited by: Bigabiga

    Drag/drop the picture you want to add on the area with the other thumbs.

  • How can I add images from collection after the book is saved?

    I am new to the Book module on Lightroom 5. I prepared a rough draft of a book and saved it with the tab on the right hand top of the main screen. Unfortunately, I saved it with the option of only saving the used images from the original collection. Later I brought up the draft book and tried to add some additional images, but see that only the images already used in the book are available on the image strip at the bottom.  I need to get other images which are in the original collection.  Is there any way to do this?  If not, is there a way to save the entire format of the book and then start over with the same format but with the original full collection as the source of images in the bottom strip?

    When you create a saved book, it creates a "Saved Book Collection" in your collections panel with a special "Book" icon. To add pictures to a saved book. Find them in your Grid mode of Library module and drag them into your Saved  Book Collection and they will be available to add back in from the Book Module.

  • Executable jar files and manifest file

    Hi,
    I have the following files in a folder named: Test
    a.jar
    b.jar
    c.jar
    Driver.class
    Driver.mf
    Here, MainClass is the main executable class that uses a,band c.jar files. This is how my MainClass.mf file looks:
    Manifest-Version: 1.0
    Main-Class: Driver
    Class-Path: a.jar b.jar c.jar
    Now I use the following command to make one executable jar file:
    jar cmf Driver.mf DriverMain.jar *
    It creates an executable jar file named : DriverMain.jar
    Now I copy the executable jar file (DriverMain.jar) into a different folder named: RunTest
    and double click it, doesn't work.
    my question is:
    what am I doing wrong? Any special characters needed in my Driver.mf file (space/newline/etc)?
    What I am trying to get is: One execuatble jar file so I can just double click to run it, and that single executable jar file will have all the necessary jars in it (i.e. a.jar, b.jar, c.jar in this case)
    Anyone please help!
    Thanks
    -Ron

    Rony,
    Sorry to disappoint, but you can not use embeded jar/zip files within an executable jar. The JDK sadly for some reason decided this was not a useful idea, so developers like me who want to distribute plugins with thier own dependencies have one of two choices. You either have to unzip the jar file that contains the embeded jars to a directory, then run your primary exectuable jar, OR you have to write a custom classloader that your "launcher" creates then loads the embeded jar files.
    The best thing to do is either jar up a, b, c and driver into one jar, so that it works, if you can legally do this. A lot of 3rd party libraries may not allow this per their license. Otherwise, another choice is to use a free installer or buy an installer that allows you to distribute a single exectuable installer program that will properly create the dir structure you need.
    As for the way it works, if you declare:
    Class-Path: a.jar b.jar c.jar
    the JAR loader code in the JDK looks in the root dir where your application was started for a/b/c jar files. They have to be on disk.
    If you want to place them in /lib, for example, you would havd a jar file like:
    Driver.class
    Driver.mf
    lib/a.jar
    lib/b.jar
    lib/c.jar
    When unzipped, your "root" dir would look exactly like the above, and your manifest would have Class-Path using ./lib/a.jar ./lib/b.jar ./lib/c.jar
    Anyway, there thus far isn't any way around this issue of embeding jar files in an executable jar file. You MIGHT be able to not specify any classpath, then in your Driver.class, create a new custom classloader that dervies from URLClassLoader, but in the findClass(), you get a ref to the .jar file that the classloader class is inside of, and from that use it to find the lib/*.jar files and add them to the classpath. For this to work, however, your Driver.class code should ALSO be contained in an embeded jar file that is loaded by this custom loader. The only thing Driver.class would contain (and I would rename it to something like Launcher) is the code to create the custom classloader.
    It's fun stuff, but a little bit of work to make it work. You can infact make it work! I may yet one day take our plugin engine custom loader and create a way for this to work!

Maybe you are looking for