How to pack the images i use in swing into jars

I know how to pack my programs into jars, but how can i also pack in my images used by my program, they dont work when outside the jar.. Thanks

i am not if my answer satisfies your requirement.
Even we also used images in my swing application and made it executable jar.
what we have done is we have done is as below
icon =     new ImageIcon(new URL("http://xyz.com/ui/v8/images/icon-information-blue.gif"));
so in this case ,no need of images to be packed along with jar ,you can access the images which is there on net..
thanks.

Similar Messages

  • How to import the image by using java application

    1.how to import the image by using java APPLICATION and display it on the textarea that you have been created.
    2.how to store the image into the file.
    3. what class should i used?
    4. how to create an object to keep track the image in java application.
    * important : not java applet.
    plzzzzzzz.
    regards fenny

    follow the link:
    http://java.sun.com/docs/books/tutorial/2d/images/index.html

  • How to view the image by using mousedrag event?

    How can i move the full image by using mousedrag event(not using scrollBar and the frame should not reziable).
    e.g
    click the mouse in image and drag right side or towards down,the image should move to till the end in width or height
    import java.awt.*;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    public class LoadAndShow extends JPanel implements MouseMotionListener{
        BufferedImage image;
        Dimension size = new Dimension();
        public LoadAndShow(BufferedImage image) {
            this.image = image;
            size.setSize(image.getWidth(), image.getHeight());
         * Drawing an image can allow for more
         * flexibility in processing/editing.
        protected void paintComponent(Graphics g) {
            // Center image in this component.
            int x = (getWidth() - size.width)/2;
            int y = (getHeight() - size.height)/2;
            g.drawImage(image, x, y, this);
        public Dimension getPreferredSize() { return size; }
        public static void main(String[] args) throws IOException {
             //set the image path
            String path = "Images/dinette.jpg";
            BufferedImage image = ImageIO.read(new File(path));
            LoadAndShow test = new LoadAndShow(image);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setResizable(false);
            f.add(test);
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
            //showIcon(image);
         * Easy way to show an image: load it into a JLabel
         * and add the label to a container in your gui.
        private static void showIcon(BufferedImage image) {
            ImageIcon icon = new ImageIcon(image);
         public void mouseDragged(MouseEvent arg0)
              // TODO drag the image
         public void mouseMoved(MouseEvent arg0)
    }

    Following is the updated code for image move on mouse move.
    import java.awt.*;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import java.awt.event.MouseListener; public class LoadAndShow extends JPanel implements MouseMotionListener,MouseListener{
    BufferedImage image;
    Dimension size = new Dimension();
    Point pt;//Maintain the Current Pressed Values of Mouse
    Rectangle rect;//Maintain the moving position of Mouse     public LoadAndShow(BufferedImage image)     {
    this.image = image;
    size.setSize(image.getWidth(), image.getHeight());
    this.addMouseListener(this);
    this.addMouseMotionListener(this);
    * Drawing an image can allow for more
    * flexibility in processing/editing.
    protected void paintComponent(Graphics g) {
    // Center image in this component.
    int x = (getWidth() - size.width)/2;
    int y = (getHeight() - size.height)/2;
    g.drawImage(image, x, y, this);
    }     public Dimension getPreferredSize() { return size; }     public static void main(String[] args) throws IOException {
    //set the image path
    String path = "C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\Sample Pictures\\Winter.jpg";
    BufferedImage image = ImageIO.read(new File(path));
    LoadAndShow test = new LoadAndShow(image);
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setResizable(false);
    f.add(test);
    f.setSize(400,400);
    f.setLocation(200,200);
    f.setVisible(true);
    //showIcon(image);
    * Easy way to show an image: load it into a JLabel
    * and add the label to a container in your gui.
    private static void showIcon(BufferedImage image) {
    ImageIcon icon = new ImageIcon(image);
    }     public void mouseClicked(MouseEvent e) {
    }     public void mousePressed(MouseEvent e) {
    pt = e.getPoint();
    rect = this.getBounds();
    }     public void mouseReleased(MouseEvent e) {
    }     public void mouseEntered(MouseEvent e) {
    }     public void mouseExited(MouseEvent e) {
    }     public void mouseDragged(MouseEvent e) {
    Point p=e.getPoint();
    moveImageOnMouseMove(p);
    }     public void mouseMoved(MouseEvent e) {
    * This Function is used for calculate the Dragging point of Mouse and set the image on particular points
    * @param p Point hold the dragging point of Mouse
    private void moveImageOnMouseMove(Point p)
    int xDelta = p.x - pt.x;
    int yDelta = p.y - pt.y;
    rect.x = rect.x + xDelta;
    rect.y = rect.y + yDelta;
    this.setLocation(rect.x, rect.y);
    this.repaint();
    }}   If you have any query related with the code please let me know.
    Manish L
    MS Technology
    www.ms-technology.com
    Edited by: mannymst on Sep 18, 2008 5:53 AM
    Edited by: mannymst on Sep 18, 2008 6:05 AM

  • How to read the Image Data using HTTp Request response

    i want to read image data from server please send me any code or answers.
    and also i want to exit application using button control for iphone simulator.
    thanks in advance.

    You would do a URLRequest and download the image. You could save it to disk and then load it or directly create a new image with the binary data.

  • How to upload the image and diplay the image in the browser using jsp

    How to upload the image and diplay the image in the browser using jsp
    thanks
    shan

    i'll suggest looking for sample code or tutorial with a relevant query in google, which as far more time than us to answer this type of reccurent question

  • How to display the image which in KM folder using url iview

    Hi Friends
    How to display the image, which is under KM folder structur using the url iview.
    i trying using url iview url as  \document\testfolder\abc.jpg as url for the iview.
    but its now working .. so please help me how to slove this problem
    If is not the correct way then please suggest me best way to achive this.
    Thanks
    Mukesh

    Hi Mukesh,
    I think this may work,
    1, Create a HTML Layout.
        You can put your image wherever  u want with HTML Codes.
        Check this, [Article|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3915a890-0201-0010-4981-ad7b18146f81] & [Help|http://help.sap.com/saphelp_nw04/helpdata/en/cc/00c93e9b2c3d67e10000000a114084/frameset.htm]
        With this, u can use the standard KM commands also.
    2, U need to use KM Navigation iView for this rather than KM Doc iView.
    3, In the Nav iView, u can use &rndLayoutSet=nameOfUrHTMLLayout to force the view with this new layout.
    Regards
    BP

  • How to store the images in KM using Code

    Hello,
    i retreived the images from KM using the following code.
    import com.sapportals.portal.prt.component.AbstractPortalComponent;
    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    import com.sapportals.portal.prt.component.IPortalComponentResponse;
    import com.sapportals.portal.prt.resource.IResource;
    public class ThumbnailTes extends AbstractPortalComponent {
         /* (non-Javadoc)
    @see com.sapportals.portal.prt.component.AbstractPortalComponent#doContent(com.sapportals.portal.prt.component.IPortalComponentRequest, com.sapportals.portal.prt.component.IPortalComponentResponse)
         public void doContent(IPortalComponentRequest request,IPortalComponentResponse response) {
    String path =request.getResource(IResource.IMAGE,"images/sap1.gif").getResourceInformation().getURL(request);
                   response.write("<img src = "path"/>");
    but i want to store the images in KM using code.Can anybody help me.
    acutally the image is my location(c:/images/sap1/jpg).i want to upload this image to KM using code.
    Can anybody help me how to do that?

    Hi Kasturi,
    > not accepting the points
    It worked on this and on one other thread, but this is still open: How to upload the image
    > want upload the images from the client side machine
    > to KM
    In the thread I just referred to, I already provided information about the HTMLB upload control. With this at hand, you'll get the file from the client to the server.
    At server side, get an ICollection instance where you want to store the file and create the corresponding resource. See https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/javadocs/nw04/sp12/knowledge management/com/sapportals/wcm/repository/icollection.html#createresource(java.lang.String,%20com.sapportals.wcm.repository.IPropertyMap,%20com.sapportals.wcm.util.content.IContent)
    Hope it helps
    Detlev

  • [CS2]How to get the Image Width & Height using JS (ILLUSTRATOR CS2)

    Hi,
    How to get the Image width & height of an Image using javascript .Im using Illustrator CS2.
    Any sample code
    Regards
    MyRiaz

    you can reference the dimensions of a loading image (or swf)
    by referencing the target movieclip's dimensions AFTER loading is
    complete. ie, use preloader code or the onLoadInit() method of a
    moviecliploader listener.

  • How to insert the image or logo into the table as a field in webdynpro abap

    Hi Friends,
    Please tell me how to insert the image or logo into the table as a field in webdynpro abap.........

    Hi Alagappan ,
          In your view layout you take table UI element and then you bind it with some context nodes.
    The attributes of your nodes comes as a field.
    Now in these fields you can set various properties and image is one of them.
    Go to ->
    1. View Layout -> Right Click on ROOTUIELEMENTCONTAINER -> INSERT ELEMENT -> TABLE
    2. Right click on table -> Create Binding.
       Here you have to bind it with the appropriate context node.
    You will get two properties here
    a- Standard Cell Editor :- ( make it image )
    b- Standard properties :- ( If required set image properties ).
    3. If you want put image from out side then import it as a mime object and set the source of your table field ( used as a image )
    also have a look :-
    [Image Properties|http://help.sap.com/saphelp_nw04/helpdata/en/f3/1a61a9dc7f2e4199458e964e76b4ba/content.htm]
    Hope this will solve your problem.
    Reply if any case of any issue.
    Thanks & Regards,
    Monishankar C

  • How to get the image stored in archieve link as an attachment in work item.

    Hi All,
    through transaction OAWD we are storing scanned images.
    Once this transaction is executed a workitem appears in the inbox of the initiator with the scanned invoice as attachment.
    When the user executes the work item FV60 screen is displayed where the user enters the data based on the scanned invoice attachment.
    After the user Parks the document the custom workflow triggers and a workitem appears in the inbox of an approver.
    Our requirement is that the scanned image should also appear as the attachment.
    Can you please suggest how to get the image stored in archieve link as an attachment in work item.
    Regards
    Shraddha

    Hi Martin,
    with every parked document a scanned image is linked.
    I need to create a link under objects and attachments in the work item, such that when the user clicks that link the image is displayed.
    At present the following functionality is available.
    The BO used is FIPP
    Objects and attachments:
    parkeddocument:AK0108500001252008.(via FIPP binding with WIOBJECT_ID)
    On clicking the link below objects and attachments: the parked document AK0108500001252008 opens in display mode.
    Now we want to have 2 links:
    parkeddocument:AK0108500001252008.
    image.
    When we click on the link image then the scanned invoice linked to the document should get opened.
    I am able to get the image id of the the image through  SAP_WAPI_GET__OBJECTS,
    export parameter leading_object provides the detail.
    But I am not able to figure out how to use it in my workflow to display it as an attachment.
    Hope this will give a better understanding of my question.
    can you please suggest as to how I should proceed with it.

  • How to store the images in Oracle?

    Hi,
    I am a new developer, trying to find out how to store the images in Oracle. Is there anyway that I can store the images in Oracle and insert them into my html file?
    Thanks!
    Sarah

    There is a simple image example available from OTN.
    From the OTN main page, go to Products --> interMedia --> Sample Code. The name of the example is "Load rich media content with a browser."
    This example loads and retrieves an image from an Oracle8i database through a web page using the Oracle interMedia Web Agent.
    Hope this helps.
    null

  • How to store the images in tables

    how to store the images in tables .what is the use of "clob ,blob"

    Using with the CLOB or BLOB, you can store the images in the table.
    Srini C

  • How to receive the images / binary data t ype

    How to receive the images / binary data type in webdynpro....
    i have a website that let's the user send email, the email attachment and message are stored in both in images data type....
    q1) can i stored the message into binary data type...but the message is very long.....
    q2) if i have a textbox ...i surely will need to display the message  in string ,right ?
    [......... msg here ........]
    what is the codes to receive the images / binary data type in webdynpro....

    As in your previous post if you are storing them as BLOB object.. am sure you are able to get a byte stream or byte array(bytes[]) out of it.
    There should be some way to identify if its a image or a message BLOB. If its a image , convert into bytes and use 
       WDWebResource.getWebResource(bytes,resource type).getAbsoluteURL()
    to obtain the url.. assign this image UI element..
    In case its the message , use bytes.toString to get the message ..
    Regards
    Bharathwaj

  • Can any one tell me how to stream the images in flash.

    Hello Friends,
    i have created a dynamic page flip book with xml, i want to
    zoom the images in swf loaded, with streaming, so that user can
    preview the image while a good quality image is loading. I wanna
    know that how to load a part of large image or swf.
    Image effect like :-
    http://www.zoomify.com/
    Can any one tell me how to stream the images in flash.

    On Thu, 17 Apr 2008 05:53:27 +0000 (UTC), "FlashDavil"
    <[email protected]> wrote:
    >I wanna know that how to load a
    >part of large image or swf.
    You show a preview and use loadMovie() to load a big file.
    You can
    create a preloader (progress bar) showing how much part is
    loaded,
    while user sees the small image. When you achieve 100% tou
    show that
    big image. What's more?
    > Can any one tell me how to stream the images in flash.
    What are you talking about is not a "streaming", but
    "progressive
    download". Images "streaming" is impossible.

  • How to reverse an image acquired using IMAQ APIs in vc++

    how to reverse an image acquired using IMAQ APIs in vc++

    When using imaqFlip, may the source and destination be the same Image* ?
    TIA!
    Jesse

Maybe you are looking for

  • Depreciation Value calculate on the basis of Scrap Value

    Hi! Experts, My client requirements are: (A) 1)     Suppose Asset purchased Value is Rs. 100000 and its useful life is 5 years. 2)     Now after 5 years sold the asset on Rs. 20000 . 3)     The depreciation should calculate on the 80000   (B) 1)     

  • Help needed in Externtal Facing Portals

    Hi  all ,   Grateful if anyone can help me in configuration & implmentation of External Facing Portal . I need to convert my intranet portal to a webportal . Thanks in advance , Ravi Shankar

  • How can I add new event handler in BC4J event flow in UIX?

    How can I declarativly add extension to existing event handleres in BC4J+UIX page? I generate through wizards UIX+BC4J pages and I want extend some actions in eventhandlers section. Can I do it in some way like <event name=".." method=".." class=".."

  • Params in queries with Jdev 10g

    I had a working UIX App and used the null event to setting parameters for my query but using 10g doesn't work. I tried setWhereClause in my application module class, calling it from the data action, but i get an error (index out of bounds). If I try

  • Photo Smart 6510e ALL IN ONE SERIES. Only prints one page.

    photosmart 6510 with windows 7. Had problems so reinstalled and now only prints one page even when set to print all