View Single Post
Old 11-16-2012, 02:47 PM   PM User | #3
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,653
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
That will add to the list. The loop doesn't make any sense though; personInput will only be either OK_OPTION or CANCEL_OPTION, so looping it is a horrendously bad idea. All it takes is changing that equality to a different comparison (equality should be avoided in loop conditions in favour of >= or <= (either with or without equals) instead) and then you have an infinite loop.

Its a bad way of doing it, you shouldn't be using a confirm dialog for this, and at the very least not without a frame so you have something to return control to. Dialogs are really more designed for "Are you sure you want to do this?" type actions, inputs into form fields really make more sense on a frame with buttons that have events added on them.

I'm not sure what's up with all these arraylists though, these look to me that you should have a single ArrayList<Person> and create a Person class to deal with all those properties. Otherwise you have many disjointed lists that cannot be properly sorted and retain any meaningful relationship.
Fou-Lu is offline   Reply With Quote