hopefully someone can help me. My program compiles fine but I get the error:
Uncaught error fetching image:java.lang.NullPointerException at sun.awt.image.URLImageSource.getConnection(URLImageSource.java:99) at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:113) at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:240) at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172) at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)
i know the problem seems to lie within the attempt to create the company logo and there is an issue with it not knowing where to look for my logo. all of my attempts to fix it have been unsuccessful. i have to to turn this in today within the next 8 hrs and would appreciate any and all help. this is my last resort i dont know what to do or how to fix it.please keep in mind i am totally new to java programming.please please please please help me.
here are the assignment details:
•Modify the Inventory Program by adding a button to the GUI that allows the user to move to the first item, the previous item, the next item, and the last item in the inventory. If the first item is displayed and the user clicks on the Previous button, the last item should display. If the last item is displayed and the user clicks on the Next button, the first item should display.
•Add a company logo to the GUI using Java graphics classes.
Are you allowed to use a full path to load your image ? If you are, you can use the following instead :
this.getClass().getResource("logo.jpg"); is going to look for "logo.jpg" in a place accessible by the Inventory5i's classloader. If you had put "logo.jpg" in the same directory as the Inventory5i.class, it would have been found. There's a tutorial here.
Joined: Dec 24, 2009
Man you are the most awesome person ever!!! I do not know why for the life of me I could not get that to work no matter where I put the logo.
I want to thank you one hundred billion times again and again.
I guess i'm just so tired of this project I couldn't see the problem.