Hello,
i'm about to try working with Eclipse and so I wrote my code in Processing and then tried it inside of Eclipse.
I've read trough the tutorial on this site, and there is basically no error given in the Eclipse debugger. (the code is copied from Eclipse that's why there are some slight changes to Processing)
Code:
import processing.core.*;
public class Processing extends PApplet {
StringBuffer buffer1;
String string1;
public int int1;
String[] lines;
public int counter;
public void setup() {
size (500,500);
smooth();
noStroke();
buffer1 = new StringBuffer();
}
public void draw() {
}
public void keyReleased() {
if (counter == 0 && key != ENTER) {
buffer1.append(key);
string1 = buffer1.toString();
int1 = Integer.valueOf(string1).intValue();
}
if (key == ENTER) {
counter ++;
}
if (counter == 1) {
analyze();
}
if (key == TAB) {
setup();
int1 = 0;
counter = 0;
}
}
void analyze() {
Farbe();
rect (mouseX, mouseY, 100,100);
}
void Farbe() {
String[] lines = loadStrings("colors.txt");
int[] colorList = new int[lines.length];
for (int i = 0; i < lines.length; i++) {
int tab = lines[i].indexOf(TAB);
String stuff = lines[i].substring(tab + 2);
int c = unhex(stuff);
colorList[i] = 0xFF000000 | c;
fill (colorList [int1-1]);
}
}
}
In Processing the code works perfectly fine. In Eclipse this code only works, when I delete the method "analyze()" and put the two lines of code inside of this:
Code:
if (counter == 1) {
analyze();
}
Does anyone has an idea why Eclipse does not accept the method "analyze"? I don't have a slightest idea.....
The debugger marks this line of code as the reason for the error:
Code:
int1 = Integer.valueOf(string1).intValue();
Thank you so very much!