The variables x, y, width, height, and adds all are a part in another part of my code, for graphics. Since they are attached to these variables, if something goes wrong, the items do not show up. That part I know for sure is working right. I removed this code and it showed just fine. Anyway here is the output (with no file in the directory):
My problem code is below. Here is the begging of my code showing initialization of variables...
I've never completely understood File inputs and outputs (I used to program with Autohotkey), so I'm probably doing everything wrong. Please help me fix this crap I call code.
cc11rocks aka John Price
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
1) never use == for String comparison. Always use .equals().
2) br.readLine() will read the next line each time it's called. I don't think you want that, but to use the currently read line instead.
3) In that case, the loop already guaranteed that the result is not null, so the second part can be skipped.
The new start of your loop:
One more possible improvement: use a switch instead of the "if check == 0 else if check == 1 ..." part.