Image takes > 8sec to paint after loading!!!

Hi,

I am having this problem of slow displaying jpg image (~120kb - 576 x 432 pixels) in my application. I checked whether it is the loading time by using a check on image height and width != -1 (and also by using imageUpdate method). I found that the loading time is quite fast but after the image is completely loaded and available, it takes more than 8 seconds to display (paint) an image on a JPanel (which I think is awfully lot to wait for). This is the case only for the first time an image is opened in the application. I also tried using the media tracker to solve this problem but in vain. I haven't been able to locate the source of this problem. I am wondering whether this is a machine related problem (corruption in some windows files) or Java related issue (probably double buffering) and also whether I should be facing such a problem. My machine config. is PIII 450, 256MB RAM 16MB Riva TNT and using jdk1.3.1 (+java3D for OGL) on Win98 SE. I tried searching for such particular problem on the forums but could not find any help. Has anyone faced such a situation? Also is there a way to display an image as it loads (like in a browser) so that the user can see that something is happening?

Thanks for any suggestions.

Nick

-

nikreations@yahoo.com

Nikhilesh Haval

MSc Software System Technology

Department of Computer Science

University of Sheffield

United Kingdom

--

[1465 byte] By [nikreations] at [2007-9-26 3:52:05]
# 1

TO display an image as it's loading you have to make a component that implements the imageObserver interface and then every time that function gets called, have the component repaint with the newest image data.

to see if your image is slow, try making a simple JLabel and assigning it's icon to your image. That way you'll know if it's your code or the JDK.

steveftoth at 2007-6-29 12:39:00 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...