Just a reminder about String comparisons. Compare two Strings like this:
if ( s1.equals(s2) )
not like this:
if (s1 == s2)
The first compares string contents, the second, string addresses (this is another artifact of reference types, remember?). Failing to use
equals() to compare two strings is probably the most common single mistake made by Java novices.