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

    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
    Posts
    266
    Rep Power
    5

    Default

    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, 12:02 PM
  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, 04: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
  •