To anyone posting large amounts of code:Please consider using something like
pastebin.com or
gist.github.com (gist can handle multiple files!), it'll keep your posts cleaner and make the code easier to read.
That managed to work perfectly. Unfortunately my new problem is that the computer I have to present it on is running Java 6, because my teacher apparently had trouble with a piece of software when it updated to 7. So to get it to run in six do I only have to use the JDK for six? And if so which would I use? The Java archive here have everything from 6 to 6u45. What are the differences between all of these?
Oh, that's one I've actually never directly dealt with. A quick google finds this
StackOverflow post about netbeans (which I've never used). If you're using Eclipse, it's under project properties somewhere (try Java Build Path and Java Compiler; "generated .class files compatibility" in the latter looks promising); I don't have a new version handy on this machine. If you're building manually with javac, the "-target" option looks like what you need.
So, it looks like JDK 7 can build for JRE 6, and you're almost certainly not using any 7-only libraries, so that should be fine. Ideally, test first. If you really want to be sure, you can always uninstall 7 and just use 6 (or try running it on some other computer that only has 6).
As for code review, the first big thing I'd mention is names. Give your variables descriptive names! Unless you're using Notepad(*), your code editor/IDE should autocomplete them, so there's no excuse to not use full words for your variable names. This is doubly important for class and method names. And always capitalize your class names! It's such a firmly entrenched convention, it's disorienting when it is broken.
Second important thing, always declare your variables at the innermost scope possible. Is that string set at the start of each iteration of your loop and never needed outside of it? Declare it inside the loop! If you're careful you can even reuse the same name in different places (with different types!).
I'll get some more detailed stuff put together tomorrow: It's 3:30am here now. Feel free to put up your most recent code.
(*)And if you are using Notepad, stop. Now. Seriously. Go download Notepad++, it's got autocomplete and syntax highlighting and tabbed editing.