Results 1 to 2 of 2
  1. #1
    Psyclone is offline Member
    Join Date
    Jan 2010
    Rep Power

    Default Question about loading images in a WebStart application

    I have a Java WebStart application that will load an image when you select an item from a list. There will be hundreds of different items in the list, and therefore hundreds of images. I was wondering if it is better to "Load an ImageIcon from a URL", or "Bundle images in my .jar file using ClassLoader". I found the two aforementioned ways above on the following website: Java: Images - ImageIcon.

    The two things I'm concerned with are:
    1) Load times - Which will load the images faster? Will adding the images to the .jar file make the program take significantly longer when I launch it?
    2) Data transfer - My website has a limited amount of data transfer allowed per month through my internet provider. Does either of these methods have a benefit to reducing data transfer?
    Last edited by Psyclone; 03-26-2010 at 10:46 PM.

  2. #2
    iluxa is offline Senior Member
    Join Date
    Mar 2010
    Rep Power


    The smaller the JAR, the faster will the program load. You bundle in the images, will take longer.
    The smaller the JAR, the less data transfer - duh.

    You should probably not transfer all images to the client on start up, since it's doubtful your client will look at every single one of them. If you fetch the images from URL upon request, it will take a bit longer to load that image, but your design is more sound. To improve the user experience a bit you could
    - have a "Loading..." kind of animation show up while you retrieve the image from the URL
    - cash the images on the client, so if the client asks for the same image twice, you don't retrieve it from URL the second time around but rather look in your local cache.

Similar Threads

  1. Loading large images in JavaME
    By b12 in forum Advanced Java
    Replies: 1
    Last Post: 04-01-2009, 11:02 AM
  2. Dynamically loading the jsp page to the application
    By shekar in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 04-09-2008, 03:28 PM
  3. Loading images in seperate packages?
    By Bibendum in forum New To Java
    Replies: 0
    Last Post: 03-02-2008, 11:43 PM
  4. Loading Images - Imp
    By Thulasiraman in forum Advanced Java
    Replies: 0
    Last Post: 01-28-2008, 10:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts