File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GIF image not getting displayed from an executable jar

 
Srinivasa Maddi
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

There is a GIF image in my executable jar. On running this jar, its not displaying the logo. Do i need to point to this gif from my MANIFEST filem, if yes please let me know how to do so
 
Maneesh Godbole
Saloon Keeper
Posts: 10976
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Srinivasa Maddi:
Hi

There is a GIF image in my executable jar. On running this jar, its not displaying the logo. Do i need to point to this gif from my MANIFEST filem, if yes please let me know how to do so


How are you loading the image?
I have found out in the past that logo.GIF and logo.gif are not the same. So you need to check your case.
No. You do not require any entry in the manifest unless you want to display it as a splash screen.
 
Srinivasa Maddi
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Manish

My app is displaying the logo before packing it into jar format. Though its running after jar'ing it, its not displaying the logo.

- - -
ImageIcon icon = createImageIcon("./Logo.gif",null);
lLogo = new JLabel(icon);
- - -
- - -
/** Returns an ImageIcon, or null if the path was invalid. */
protected ImageIcon createImageIcon(String path,String description) {
java.net.URL imgURL = getClass().getResource(path);
if (imgURL != null) {
return new ImageIcon(imgURL, description);
} else {
System.err.println("Couldn't find file: " + path);
return null;
}
}
 
Maneesh Godbole
Saloon Keeper
Posts: 10976
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does this get printed?
 
Srinivasa Maddi
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No
 
Maneesh Godbole
Saloon Keeper
Posts: 10976
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Srinivasa Maddi:
No


Can you post asscce code so we can try and figure out whats going wrong.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remove the dot from "./Logo.gif"; it has no place in a path specification like this.

Is the file located at the root of the jar file? That's what "/" means.
 
Srinivasa Maddi
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all

Its working perfectly since i removed . and / too and hence using only "Logo.gif". Thanks again

Javaranch is really useful and moreover i am getting prompt responses these days
[ October 22, 2008: Message edited by: Srinivasa Maddi ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic