0

My iterator method is having trouble finding an entered record. The method I am using is this:

iterator = gamesList.listIterator();
int Code = Integer.parseInt(JOptionPane.showInputDialog("Enter Code:"));

boolean Found = false;

for (int i = 0; i < gamesList.size(); i++) 
{
    setMembers(iterator.next());
    if(obj.getId() == Code)
    {
        Found = true;
        break;
    }
}

if(Found == true)
{
    System.out.println("Success!");
}

This method is proven to work with other programs of this type.

Albert
  • 141
  • 3
  • 12
GipsyD
  • 206
  • 1
  • 3
  • 16

0 Answers0