• Post Reply Bookmark Topic Watch Topic
  • New Topic

Images are not showing up...  RSS feed

 
J Bone
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a Java application using JBuilder. My directory structure is
the following(these are generic names):
ProjectFolder
bak
src
package
.java files
images
.jpg files
classes
package
.class files
This structure works fine in JBuilder and jpg images show as they should.
I am using the following code to add images to some JButtons:
ImageIcon("./images/*.jpg")
My problem is when I put the classes/package directory in a jar file. I am also putting the images directory in the same jar. The executable jar does not show the images on the executing program. What have I done wrong? I am using winzip to compress files; I am then changing the file extension to jar. The program executes fine, but without images on my JButtons.
Thanks for any help,
Jason
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use icon No. 4, you may add a code-block ([ code]) around your dir-structure, so that we see what you mean:

You may not just use "./images/foo.jpg", but

[ May 16, 2004: Message edited by: Stefan Wagner ]
 
Lalit Kumar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think you can show ".jpg" images in file.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!