Solved

making a jar file

Posted on 2004-10-26
259 Views
Last Modified: 2010-03-31
Hello again !

I finally finished my application using GUI and
I made a .jar file !
when I launch it Everything is OK but the pictures dont appear !
(I included them though !!)

Does anyone of you know how make those appear in my appli ?
Thanks
0
Question by:KouKi
    8 Comments
     
    LVL 86

    Expert Comment

    by:CEHJ
    There could be any number of reasons for that! ;-)
    0
     

    Author Comment

    by:KouKi
    when i run my program in Eclipse, I have the pictures,
    but when i export it into a jar file i can't see those anymore,
    is it possible i need to use a MediaTracker in my program ?
    0
     
    LVL 8

    Expert Comment

    by:kiranhk
    how r u giving the path to the pictures in your code?
    0
     

    Author Comment

    by:KouKi
    Im using Eclipse
    I need to check what I need
    I checked "default package" (all the classes are checked)
    and "images" (and all the images are checked)
    0
     
    LVL 3

    Expert Comment

    by:aviadbd

    Yes, but how are the pictures referenced to in your code? (Not when you create the jar).

    AviadBd.
    0
     

    Author Comment

    by:KouKi
    new ImageIcon("images/down.gif");
    ...
    I have a directory images that containts all the pictures ..
    I tried also to put ->
    new ImageIcon("down.gif");
    like this and have all the pictures in the project directory
    but when i run the jar i still don't see any
    0
     
    LVL 8

    Accepted Solution

    by:
    use
    new ImageIcon(this.getClass().getResource("down.gif"));
    or

    new ImageIcon(this.getClass().getResource("images/down.gif"));
    0
     

    Author Comment

    by:KouKi
    Thanks !!!!!!! :-)
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    The viewer will learn how to implement Singleton Design Pattern in Java.
    This video teaches viewers about errors in exception handling.

    913 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now