• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Images are not showing up...  RSS feed

 
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
 
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 ]
 
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!