Hey everybody, I wasn't quite sure where to put this one.
I have a program that reads an HTML file from the net. It runs fine in Processing but I get an OutOfMemoryError on trying to export (both as an applet and a standalone app). The debugger is trying to tell me something about the "Java heap space," which to me sounds like a fancy way of saying a pile of dung, but I'm probably wrong.
Peep the
Code:
import simpleML.*;
PFont fontA;
void setup() {
size(640,480);
HTMLRequest req = new HTMLRequest(this, "http://api.wefeelfine.org:8080/ShowFeelings?display=text&returnfields=sentence&city=providence&limit=100" );
req.makeRequest();
fontA = loadFont("04b03-40.vlw");
textAlign(CENTER, CENTER);
}
void draw() {
}
// When the request is complete
void netEvent(HTMLRequest ml) {
String html = ml.readRawSource();
String[] list = split(html, "<br>");
// takes last 100 from the top
for (int x = 0; x<49; x+=1){
background(0);
textFont(fontA, constrain(170-list[x].length(), 50, 90));
text(list[x].toUpperCase(), random(10,30), random(-60,-20), 600, 480);
int y = list[x].length();
delay(y*100);
}
}
Any ideas anyone? It would be greatly appreciated.