This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Image Arrays Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Image Arrays" Watch "Image Arrays" New topic

Image Arrays

PM Knight

Joined: Aug 17, 2004
Posts: 2
I'm trying to create an array of images, but am not sure how to go about it.

Any ideas???

Plus how would I specify the folder where the actual image was found on my computer?

Thanks in advance for any help!
John Melton
Ranch Hand

Joined: Aug 17, 2004
Posts: 49
If I am understanding your question right.... this is one possible solution (probably not the best, but the first one I thought of)
You could make a class called "" that might look something like this.

Then, you could just get an array of images since you made a new class of your own.
You might say somewhere in another class :

Somewhere you would have to write the code for what you wanted to do with the images. I am not sure what you wanted to do, but there are a lot of good pieces of code over in the code repository on java ranch and for bigger projects, check out Sourceforge

Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
Or you could just use and not worry about all that horrid platform-dependent slishing and slashing.

Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
I'm trying to create an array of images, but am not sure how to go about it.

Any ideas???

Are you stuck on a particular part? Is working with images new for you? Is working with arrays new for you? Are you generally not sure where to get started?

You might like to make use of java.awt.Toolkit and java.awt.Image.

If you're not yet comfortable with arrays, I'd suggest taking a look at chapter 8 of David J. Eck's "Introduction to Programming Using Java" and chapters 46-49 of Bradley Kjell's "Introduction to Computer Science using Java".

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link:
subject: Image Arrays
jQuery in Action, 3rd edition