Urgent : everything works fine, but cannot find a .jpg file

This is my first attemp at creating a jar file and running the running the program
i created a jar file ran it, everything works fine but when i click the about menuitem, it throws a java nullpointer exception,
it says it cannot find the .jpg file that is used for the about box,
the code works fine if i run as a normal program i.e
java <somepackage>/<classname>
javax.swing.ImageIcon aboutimage;//in the constructor
try{
aboutimage = new javax.swing.ImageIcon(getClass().getResource("resources/image/"+"About.jpg")); //-- exception at this line
               }catch(Exception e){
                    e.printStackTrace();               
               }

i post a bit more details in case sm1 might want to refer,
Thanks in advance ..it's a bit long sorry for the inconv.
I created a jar file this way,
- first created the Manifest.txt file and added the the main class,
follwed steps from the tutorial at sun:
http://java.sun.com/docs/books/tutorial/deployment/jar/appman.html
then this at command prompt
jar cfm Aid.jar Manifest.txt IDTT/
Now when i run the jar file every thing runs fine except for the About.jpg,
that file doesn't show up when i click the about button in the application
Everything works fine when i directly run the file from command prompt as java IDTT/Aid
Error recieved:
Exception in thread "AWT-EventQueue-0"
java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(Unknown Source)
at IDTT.Aid$AboutPanel.<init>(Aid.java:336)
at IDTT.Aid.menuItem_AboutActionPerformed
(Aid.java:304)
this is line 336 in Aid.java:
javax.swing.ImageIcon aboutimage = new javax.swing.ImageIcon(getClass().getResource("resources/"+"About.jpg"));
Aid.java has package as
package IDTT,
the files in folder graph
have package as
package IDTT.graph
"resources" is a normal folder that has a image file called About.jpg
and another folder called "html" that contains many html files.
there's no error for html files
This is the package/folder tree structure
IDTT
|
|- Aid.java (has main)
|
|- graph (a package that Aid.java uses)
|
|_ resources
    |
    |- image
    |      |--- About.jpg
    |
    |- html

Similar Messages

  • Hi. I have set up the trial versions of Photoshop CC 2014 and Lightroom 5.6 (ie the Photography plan) on a desktop that I have added a new drive to with Windows 7. Everything works fine BUT it is an old computer and I'm thinking that it may pack up unexpe

    Hi. I have set up the trial versions of Photoshop CC 2014 and Lightroom 5.6 (ie the Photography plan) on a desktop that I have added a new drive to with Windows 7. Everything works fine BUT it is an old computer and I'm thinking that it may pack up unexpectedly. These things happen. I want to sign up for the Photography plan but I also have a Windows Vista laptop, and that is old too so I may want to put the apps on a new desktop and a new laptop, having already installed on my desktop. That makes three activations. Am I allowed to do this? Cheers. Paul

    You cannot have three activations. It's simply not technically possible. If and when the time comes, you simply deactivate/ sign out on one of the old systems and install on the new one. If the system goes belly up, you contact support to reset your account. No need to make it more complicated than that and overthink it.
    Mylenium

  • Hello, I've just tested my form on all mac navigator (safari, google chrome, opera, firefox) everything works fin, but I've encountered a message error when i tested it on a pc (windows 8, explorer 11.0) : [ref: 4TjwhtHy2SB5C8LI-Eku2A, serverError]-

    Hello, I've just tested my form on all mac navigator (safari, google chrome, opera, firefox) everything works fin, but I've encountered a message error when i tested it on a pc (windows 8, explorer 11.0) : [ref: 4TjwhtHy2SB5C8LI-Eku2A, serverError]…

    Hello, I've just tested my form on all mac navigator (safari, google chrome, opera, firefox) everything works fin, but I've encountered a message error when i tested it on a pc (windows 8, explorer 11.0) : [ref: 4TjwhtHy2SB5C8LI-Eku2A, serverError]…

  • Sync archive is successful, but cannot find latest config file in the config viewer

    Sync archive is successful, but cannot find latest config file in the config viewer, Prime LMS 4.2.4

    Hi,
    Go Admin > Collection Settings > Config > Config Archive Settings
    Make sure   enable shadow directory is Checked
    Also check you have folders like shadow , devfiles ..etc under NMSROOT/CSCOpx/files/rme/dcma
    If these folders are missing ... then it is a database issue..
    if files and folders are fine then check if it happening for any particulr device or set of devices or all the devices ?
    Thanks-
    Afroz
    ***Ratings Encourages Contributors ***

  • HI there, i purchased CS5 Photoshop back in 2010, and had to format my mac.  Now i need to download my CS5 again, but cannot find the download files.  Where can i find the download of CS5? I have my serial code but cannot find the download.

    HI there, i purchased CS5 Photoshop back in 2010, and had to format my mac.  Now i need to download my CS5 again, but cannot find the download files.  Where can i find the download of CS5? I have my serial code but cannot find the download.Downloading, Installing, Setting Up

    Downloads available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4 | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  12 | 11, 10 | 9, 8, 7
    Photoshop Elements:  12 | 11, 10 | 9,8,7
    Lightroom:  5.6| 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • When using Time Machine in Mac Mail, everything works fine but restored files do not appear in MM - On My Mac, and I cannot find them anywhere.  Thanks

    Time Machine Problem: Mac Mail.  Cannot Find Restored Files in Mac Sidebar where they are supposed to go.
    I am using Mountain Lion on my MacBook.  I have successfully used Time Machine in the past, but I have incurred the following problem that I am requesting help on.
    I am attempting to recover Sent  and Inbox Mac Mail sent.  I go through all the steps properly and locating what I want to recover, and after hitting Restore everything seems to be working and I get a message "Restoring 207 files".  The guides say that then I am supposed to find the files in Mac Mail sidebar under   ON MY MAC.  But they are not there nor anywhere else I have looked.  In other words, everything appears to be working fine except I cannot find the restored files.
    Thank you for you help.
    Jerry

    Although you can restore messages from a Time Machine snapshot within the Mail application, it generally won't work with messages that were saved by an older version of Mail. In that case, you have to use an alternative method.
    Triple-click the line below to select it:
    ~/Library/Mail/V2
    Right-click or control-click the highlighted line and select
    Services ▹ Reveal
    from the contextual menu. A Finder window should open with a folder selected. Inside that folder are subfolders representing your Mail accounts. The names refer to the email addresses you use. Decide which ones you want to restore messages from.
    Enter Time Machine and scroll back to the snapshot you want. Select the account folders you want and then selectRestore ... to... from the action menu (gear icon) in the toolbar of the snapshot window. Restore the folders to the Desktop, not to their original location.
    From the Mail menu bar, select
    File ▹ Import Mailboxes...
    Import from the mailboxes in the folders you restored to the Desktop. The imported messages will appear in a new mailbox. Move the ones you want to keep wherever you like and delete the rest. Then delete the folders on the Desktop.

  • I have an Airport Express that works fine but cannot get the audio to connect or play through my Samsung AV-R370 receiver. I

    I bought a 3.5 mm to 3.5 mm connecting cable to connect the Express to some outlet on the receiver back but am unsure which one to connect to. They have a combination of coaxial and optical plugs, nothing looks like a 3.5mm jack. I also bought a 3.5mm stereo Y-adapter cable to connect the Express to whatever coaxial jack on the back of the receiver. I tried all but could not get a sound out of the system. I checked with earbuds to see if music was coming out my Iphone 4s through the express and it does so obviously it is a connection or setting issue. Everything works WIFi, but want music to stream through my Samsung system which includes TV,AV receiver and BluRay player.
    Any help would be appreciated as I am new to this.

    You basically have two choices: 1) Find the best physical placement of the AirPort Express to support multiple locations, or 2) Get another Express to extend the wireless range of the first one.

  • I've just setup my new iPad Air. With new Apple ID ect everything working fine, but I can't redeem my iTunes voucher it says wrong password/ user name but they are not wrong. I've reset password same problem anyone help?

    II've just setup a new iPad Air for my daughter with a new apple ect, everything is working fine, but I can't get it to redeem the I tunes voucher. It asks for I'd and password, put them in and comes up with wrong Id/password. They are not incorrect answers, but reset password just incase. Same problem. Also tried making another apple account. Same problem again can anyone help?? Please  

    Your iTunes Voucher is link to the old Apple ID.

  • Hello, I have the usual issue to use AcroExch.PDDoc/AcroExch.App/AcroExch.AVDoc objects in Visual Basic (MS EXCEL). On my company's machine I have Acrobat X and everything works fine, but I have another machine with just "Reader" installed - is there als

    Hello, I have the usual issue to use AcroExch.PDDoc/AcroExch.App/AcroExch.AVDoc objects in Visual Basic (MS EXCEL). On my company's machine I have Acrobat X and everything works fine. I am looking for the cheapest solution to get the stuff running on another machine... is there any way to do that with the Acrobat SDK, or do I need to purchase a full version of Acrobat XI ($$) ?

    The Acrobat SDK is nothing by itself. It is just information on how to automate Acrobat - just as the Office SDK doesn't include Office, but is for people who already have purchased Office but want to automate it.
    These automation things are MARKETING TOOLS FOR ACROBAT. Consider this and the technical limitations make a lot more sense.
    So, yes, you need to buy Acrobat. Standard is cheaper than Pro.

  • Lightbox Gallry, works locally, but cannot find prev/next/close button remotely.

    Hi all, I've downloaded the latest Lightbox Gallery from Dreamweaver exchange and was able to make some changes on my own, but still far from being an expert at scripting...HELP!
    Everything worked fine locally, but when I uploaded it to my web host/s FTP, the prev, next and close buttons did not show up.
    In firebox, they just don't show.  In Safari, it shows "?" where the close button should show.
    I checked the FTP and the images are all there.
    Could anyone tell me what I'm doing wrong?
    My website address is:
    julieappelt.com
    Thanx

    It appears you didn't upload a whole folder.  The "lightbox" folder inside the "images" folder does not seem to be there.  Try uploading the files again.

  • Help! Turned on my macbook, everything works fine, but it beeps every 4 sec

    I have a Macbook pro 2.4 ghz. Bought it about a month ago, and everything worked fine until I turned it on just now. Everything works fine, however the computer beeps ever 4 seconds at a consistent interval. tried to look it up on the support page, but couldn't figure out what's wrong. Any ideas. Please help!!! I have tests coming up and can't afford to send it in to get diagnosed. Thanks.
    David

    Does it Beep once or 4 times at each Interval, they imply different problems?
    Does the front button light flash at the same time ?
    See here for more: http://www.welovemacs.com/whdoallthbme.html
    It does sound like a RAM problem, you could try re-seating the card(s) in the slot(s).

  • Water Damage .. Everything works fine but internal speaker

    i don't know y .. i was using ipod near around swimming pool... .anyway.. i dropped it.. while my ipod play music..
    i coundn't turn off my ipod.. i was so dumb..
    now..everything works fine..but internal speaker doenst work..
    when i unplug headphone and then use volume it shows headphone volume ...not regular volume.. ..
    is that meanning internal speaker broke?

    I would like to reply to make a final update. I was fixing a screen for a friend and had all the tools that came with the screen. I decided I might as well have a peek at mine and maybe blow dry inside my phone.
    Well I pulled the LCD cable and could see slight corrosion on the one corner and what looked to be a little black. I figured it was shorting on that corner. I cleaned with some contact cleaner and scrapped it off gently as best I could.
    Plugged everything back in and bam she works. I understand this voids my warranty but I figured I was out of warranty with the water sensors triggered.
    Thanks again for your help and advice!
    Robb

  • I have a I phone 4. I recently changed carriers to straight talk it was working fine but I deleted the vpn file on accident. Now I can't get cellular data. Does anyone know how I can reinstall that file or download it somewhere?

    I own a I phone 4. I recently changed my service from AT&amp;T to Straight Talk. It was working fine but then I deleted the vpn file on accident. Now when I try to get on line I get a message that I am not signed up with a cellular data network. Does anyone know how I can retrieve or download the vpn file?

    I have taken it back to the Apple store genius bar, but they say they don't see anything wrong. Well unless you use it all day and experience the problems when they happen, you wont see anything wrong. But there are lots wrong with it. But this would be the same store as I purchased the phone. And they backed up my old Iphone 4, but were not able to get anything to load back onto my new phone. So, I lost pretty much everything. But over time, some of my contacts have started showing up, although i am still missing over 800 of them.

  • "VTR OK" and device control works fine, but cannot capture? Please Help.

    I am unable to capture my camera HDV footage by firewire to my new project on FCP.
    When I open up Log and Capture everything is working fine except the screen is black and it wont capture? VTR is ok and when I press play it plays on my Camera lcd panel but not on FCP.
    Can anybody help?
    Thanks
    Max.
    Message was edited by: Maxon007

    Camera: Sony HDV Z1. Set to "auto" not "HDV"
    Capture preset: HDV
    In 'log and capture' the (capture settings) only provides a scratch disk option and nothing else? I have seen on tutorials that show alternative options on this toggle. This might be the problem.
    Practically all is working fine except It wont capture. When asking it to capture "clip" it begins to work but the screen is blank and it sort of thinks its doing the job but its not?
    Max
    Message was edited by: Maxon007

  • Connected Digital AV Adapter to HDMI HD TV. Photo slideshow works fine but cannot play iTunes playlist concurrently (with sound turned off on slideshow)

    Connected Digital AV Adapter from my iPad (64 GB 4G) to my HD TV. Tried playing slideshow (with sound off) concurrently with playing iTunes playlist. Video plays fine but no audio. iTunes volume indicator not showing any volume.

    Just following-up on this posting from a week or two ago and another a few days later about the problems with catch-up TV.  We were disappointed with the lack of service, but as we can get most of the catch-up we want on the Sony Bravia TV, hadn't pursued it with BT perhaps hoping things would improve.
    Got a phone call last week from BT asking if we'd been able to set up the YouView Box OK, which we had.  Mentioned the unsatisfactory service.  She immediately put me through to the BT technical call centre in India where I spoke to guy called Rajiv or something like that.  Asked a few questions and then asked me to switch off the YouView Box (back panel switch) and do a hard-reset on the Homehub Router.  Once this had been done, and the YouView box switched back on.  The service ran fine and has done so since.  I don't know if Rajiv did anything in the network or whether this is just some problem (he called it a "glitch") in the router/YouView box.  Funny that that the speedtest and streaming to the Sony TV works OK.
    He phoned back a couple of days later to see if we'd had any further problems.  Overall good service.  It would be interesting to know from a technical point of view what the problem was and how it was solved.  It shouldn't be necessary to reset boxes in this way.

Maybe you are looking for

  • Multiple Copies of Same Song:

    Hi, The title may indicate that this is probably a redundant post... I don't think it is. I searched several terms with no success for my question. Here goes: I'm curious about why I have two folders per artist: one in /Home/Music/ and one in /Home/M

  • Help with File Upload manually

    Hi Experts, I need code to upload a file without using the upload UI Element. we have our terms and conditions which has to be signed by the user and once the user signs and clicks the next button to go to the next page, I generate a pdf with the tim

  • Opening & Editing forms created in LC ES on PC on a MAC using Acrobat 9

    I created 2 forms in LC ES on PC and now need to open them on new MAC using Acrobat 9 pro...It won't allow me...says it is an XML form. What do I need to do to fix this problem.

  • Access Photoshop "Help" without launching Adobe AIR?

    Is there a way to access Photoshop Help, from the Help menu, without installing or launching Adobe AIR? I'm not a mobile app developer, plus I've been seeing many security concerns and other problems related to Adobe AIR, like log files filling up ha

  • Does anyone know how to get a free movie flash player

    [email protected] hi i'm trying to watch premium movies on my iphone and i need a flash player does anyone know where i can get a good on for free?