Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generat JAR file with resouces such as picture and music!

 
magic zha
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have such program:

I have generate the jar file by command:
jar cvfm Test.jar mymanifest.mf TestPanel.class
when I double click it,the programe worked and the picture displayed.
But when move the jar file to other place,why dosen't the picture display?
Please help me ,thank you!
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try it like this, if it still doesn't display - check the capitalisation
of the image fileName

 
magic zha
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried , but still failed.
The programe always display a dialog which indicates the URL=null,and can't display the image.
I use the command:
jar cvfm ImageInJar.jar manifest.mf ImageInJar.class ImagePanel.class TEST.gif
 
magic zha
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried , but still failed.
The programe always display a dialog which indicates the URL=null,and can't display the image.
I use the command:
jar cvfm ImageInJar.jar manifest.mf ImageInJar.class ImagePanel.class TEST.gif
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your code looks like it is looking for TEST.GIF and your jar command used TEST.gif (upper/lower case difference).

Otherwise it looks like it should work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic