This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
What have you put into the Set in the first place? If there are Integers in it, there is no need to mess around with the parseInt and toString methods; you simply get the Integer out and can convert it to an int with auto-unboxing if necessary.
Your code is poorly formatted, which makes it difficult to read; there should, for example, be a single space after the semicolons in the for () line. Put the line starting int i = inside a try block, then follow it with a catch, so ti reads like thisThat will allow you to see what you have in your Set that isn't a number.
And why don't you parameterise the set as a Set<Integer>?