Hi,
The code below compiles without any errors. It's rather a logical problem. The actionPerformed method below loops through a list of Question objects ,While there is an element ahead using the hasNext() method where then if the button 'hitMe' is clicked will set text on a label, which all works fine. But however it loops through the entire list of before I can hit the button a second time. I am trying to list a question every time i click the 'hitMe' button?
Thanks in advanced
public void actionPerformed(ActionEvent e)
{
questionIterator = questions.listIterator();
for(Question currQuestion: questions)
{
while(questionIterator.hasNext())
{
if(e.getSource() == hitMe)
{
Question currQ = (Question) questionIterator.next();
questionLabel.setText(currQ.getName());
break;
}
}
}