This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to load a directory of images to an applet?

 
Khair Bahir
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,

This is a snippet of how I'd normally load images (where the images are cards) from the directory "images":



What if I had 52 cards? Is there a better way than to write out every statement?
 
Campbell Ritchie
Sheriff
Pie
Posts: 47292
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If they have names with consecutive numbers, you can run a loop and add the numbers to the strings.

getImage(getDocumentBase(), "image" + i + ".gif");

That depends on the images being named consecutively.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic