Hello, I have an applet that need to read a large image (9200x9200). For not haging the users around, unable to do anything but wait, I use a class extending Thread to load the image so that the users can quit the applet as they want. My problem is I can't draw a string showing the loading procedure. I'm doing it this way: Getting the Graphics object in the loading class and drawing the loaded data ratio, but it's not working. Here's a part of my code:
"g is not null." is printed during loading, so this is not a question about getGraphics(), but I still get nothing shown on the screen. What's the problem with it? If this is not a right way, why not?
why dont u use println to print the value u r using in drawString(), , might be that the value itself is null, and dont forget to check for exceptions !!!
JAY KUMAR CHANDRAN<br />Sun Certified Java Programmer 1.4.2
Joined: Feb 17, 2004
Thanks, jack, you're right. Now I'm printing any messenge in the console window. It's convenient, yet it only works with the appletviewer... I found the solution to this problem somehow, which is putting the getGraphics() maethod in the reading loop. I don't know why, so I'll appreciate if someone can explain it for me.