• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with my logo

 
felix ortega
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this FAQ.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

If the logo is not found, the url will be null. Where did you put it ?
 
felix ortega
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In regards to your first reply---gotcha and I wont let it happen again

In regards to your second post---this is where the file is on my computer:
C:\Users\Felix & Karen\Documents\School Folder\IT 215 Materials\logo.jpg

Is that what you meant?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
felix ortega
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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.

Cheers to you!!!

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic