3 Replies Latest reply: Jun 6, 2008 12:07 AM by 800351 RSS

    how to display the picture when the filename is not in order

    807591
      hi..anyone help me on this,

      in my picture file, i have a list of image and some of the filename is missing ( or been deleted already)
      0001.gif
      0002.gif
      0010.gif
      1001.gif
      9800.gif
      9999.gif

      now i would like to display .I use the JLabel as the container to display my picture and the picture set as ImageIcon.

      i can veiw when i press the "next" and " previous" button if the picture file in sequence which is
      0001.gif
      0002.gif
      0003.gif
      0004.gif
      0005.gif
      0006.gif

      as i can access using this code

       for (int i = 1; i <= TOTAL_NUMBER_OF_IMAGES; i++) {           imageIcon[i] = new ImageIcon("/image/flag" + i + ".gif");                                } 
      can someone give me some idea or notes or example on how to show when i click the "next" and "previous" it still show the image when the filename is not in order as above .

      thanks...