Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: retrieve multiple images

  1. #1
    Member
    Join Date
    Jan 2014
    Posts
    209
    My Mood
    Depressed
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy retrieve multiple images

    no need


  2. #2
    Junior Member
    Join Date
    Nov 2011
    Location
    Aarhus, Denmark
    Posts
    28
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    You could move your image retrieval code into its own method, if you make the method signature something like this:

    public JLabel retrieveImageLabel(int imageId)

    Then change the code to lookup the image with the given id instead of always using id 1, and returning the JLabel when it's set up.

    This way you can get all the images you like just by calling this method with the appropriate id.

    Rolf

  3. #3
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: retrieve multiple images

    Welcome to the Forum! Please read this topic to learn how to post your code correctly along with other useful info for newcomers.

  4. #4
    Member
    Join Date
    Jan 2014
    Posts
    209
    My Mood
    Depressed
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: retrieve multiple images

    are you able to give me a sample code of what you mean?

Similar Threads

  1. JLabel, multiple images?
    By tonynsx in forum AWT / Java Swing
    Replies: 5
    Last Post: November 24th, 2013, 10:40 AM
  2. retrieve data from database using Hashmap (multiple values in one key)
    By ashin12 in forum Collections and Generics
    Replies: 2
    Last Post: April 4th, 2012, 05:22 AM
  3. [SOLVED] Using multiple timers to draw images??
    By athrun8703 in forum AWT / Java Swing
    Replies: 21
    Last Post: March 26th, 2012, 11:02 AM
  4. Help with adding multiple images to an application
    By Jumbosize in forum Object Oriented Programming
    Replies: 9
    Last Post: February 26th, 2012, 12:52 PM
  5. Saving multiple images
    By Dario in forum Java Theory & Questions
    Replies: 3
    Last Post: January 25th, 2011, 01:59 PM