keep an array, or a list with types you've already added.
when you create a new one, check in that array or list whether it already exists, if not, add it to the list, if it does, ignore it and create a new one.
for future reference, when you say: this is my main method, you may want to show the complete code you have in the main method, that might be easier for us.
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433