FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   HashMap Initialization failure
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: HashMap Initialization failure  (Read 693 times)
funkdafiedevil


HashMap Initialization failure
« on: Jan 10th, 2003, 8:17pm »

Proce55ing version:47:
 
Hello,
 
I am having a problem loading the Applet when I export the sketch to the web.  The sketch works fine within the environment but the applet it generates does not execute or load.
 
I've narrowed down the problem to a HashMap initialization.  Here's a snippet of the code:
 
///begin snippet///
HashMap boxBuffer;
int frame_width=600; int frame_height=500;
 
void setup(){
  size(600,500);
  background(255,255,204);
  noLights();
  boxBuffer=new HashMap();
}
 
loop(){
//
}
///end snippet
 
It seems that the Applet has problems initializing the HashMap().  Commenting out the "boxBuffer=new HashMap();" seems to bypass the problem but if I do that I won't have access to a HashMap.  Also, it doesn't matter where in the code I initialize the HashMap.  Wherever I place it, the Applet still fails.  
 
If you're curious as to why I need a HashMap, I need some sort of key-value storage device.
 
Thanks for any help.
 
eviljim
 

eviljim
tyrannasaur.us
fry


WWW
Re: HashMap Initialization failure
« Reply #1 on: Jan 10th, 2003, 9:24pm »

exported applets can only use java 1.1 features since that's what's supported in most browsers.. HashMap is in java 1.3, so it's available in the environment but not for export.
 
you can use a HashTable which will give you a similar type of lookup method.
 
Pages: 1 

« Previous topic | Next topic »