• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Regarding Applet Download

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
i have a question regarding the Downloads of the Applet . The jar size of the applet is around 38 kb and along with this i have to download 20 images hence because of this applet takes along time to download . Can anyone suggest me some way so that i can reduce the download time .Well there would be some way thru which i can download all the images in one single connection

 
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Put the images in the jar! That was one of the original reasons that Sun created JAR format.
 
vikram sawant
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ,
Thanks for taking out time , Ok but can u put fwd me the code how u are going to access the images thru the jar Foramat because while creating the Image object we have to specify the path where the files are stored . wat about that? Can u exactly how r u going to download the image file by keeping them in the Jar Format with an example (i mean by writing a code )
 
Tim Holloway
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The getCodeBase() method is used to get the handle that allows you to reference the downloaded image. This is pretty basic stuff that can be found in most into Java books. I use the O'Reilly "Java Examples in a Nutshell".
[This message has been edited by Tim Holloway (edited August 03, 2001).]
 
vikram sawant
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ,
it seems u didntget my question while downloading the image the following procedure is normally employed
Image img = getImage(getCodeBase(),"image/name.gif" )
MediaTracker md = new MediaTracker(this);
md.add(img,1);
try
{
md.waitFor(1) ;
}
catch (Exception e)
{
}
so now the Question is if i am putting it in the Jar format wat will be my code and how am i going to refer to the image file name .gif in the getImage method
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found your answer on Sun's website... here's the link if you want to read it yourself... http://developer.java.sun.com/developer/qow/archive/76/index.html

Basically, all you have to do is this...



Where MyClass is the name of the class this code is in, and "abc.gif" is the filename of your image... Then you can put this image through the MediaTracker!

HTH,
-Nate
[This message has been edited by Nathan Pruett (edited August 03, 2001).]
 
If you are using a rototiller, you are doing it wrong. Even on this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic