Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Image Arrays

 
PM Knight
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
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
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 "Image.java" 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
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you could just use java.io.File.separator and not worry about all that horrid platform-dependent slishing and slashing.

Jules
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic