You can convert an int to String with the String.valueOf(int i)
method, but you will often see people using string concatenation because Java will find a way to convert any non-string values to string in order to perform the concatenation. That's the method Seldar hid carefully in his undocumented code (line 15) - concatenating the int with a string value of "" to force conversion of the int to string.
More seriously, when you change the title of a JFrame 5000 times in some tiny fraction of a second, what exactly do you expect to see on the screen when Swing finally gets its slice of CPU time?
...and before someone with limited Java knowledge suggests wait(1000) or sleep(1000), have a look at javax.swing.Timer.