English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

It's very weird. i load 80 images and it works.
but then i load 60 smaller images and i get a message "Applet not initialized" when i try to view the applet.

This applet i'm making is a game in the form
applet{

run()

star()
stop()
paint()
and other methods

}
and i load the images in the form
x = getImage( getCodeBase() + "hello.jpg" );

and i also use Mediatracker to track images. I give each loaded image a tracker id. then at the end of init() , i say t.waitForAll.

It's weird, how the program loads 1000 X 600, but can't load a bunch of images that are 40 X 47, or 100 X 100 , or something like that. Also, for loading 80 big 1000 X 600, it was just a test to see if it was a memory problem why i couldn't load the other images. But loading 80 big images and no problems,,, ,that made me think it's not memory related,, but who knows what else.

By the way this is not used in the web. it's an applet i use in my computer

2006-10-28 03:06:09 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

Have you tried instrumenting your code? In other words, have you tried putting in println() statements and also bringing up the Java Plugin Console to see if/what exceptions are being generated? Apparently, something "bad" is happening in your init() method.

Go to Control Panel -> Java (Java Control Panel). Select the Advanced tab, expand Java Console, and select Show Console. This way, you will get more feedback on what is happening at runtime (exception stacktraces, etc.).

BTW, I have seen this problem before, and it is typically due to a "bad" file name, e.g. a file name typo. I often will rename the files to something like t1.jpg, t2.jpg, etc., so that I can load them in a loop that just incremements the "base" name, thus avoiding typos:
for (int i = 1;i < 20; i++){
String file = "t" + i + ".jpg";
x = getImage(getCodebase() + file);
appletContext.showStatus(
"Loading image " + file);
}

2006-10-30 18:27:02 · answer #1 · answered by vincentgl 5 · 0 0

Java makes use of executable JAR records. on your IDE, you will be able to desire to have an option to construct, carry on the comparable time, installation, and so on. this might desire to create an JAR rfile it quite is executable and found it somebody on your rfile device. optimal IDE's have a launch, bin, installation folder to maintain the compiled JARs. The JAR records contain all your compiled training, factors, and distinctive themes that are secure on your venture. in case you decide on on the residing house residing house windows ".EXE" extension on your records, then C++ has some wrapper libraries for springing up .EXE records from JAR records.

2016-12-28 07:06:28 · answer #2 · answered by louder 3 · 0 0

fedest.com, questions and answers