• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Image Arrays

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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".
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic