[EMAIL PROTECTED] schrieb:
> I meant "Why the number can be 'seen' inside the listener, but not the
> ListIterator?"
your original mail hasn't arrived here, yet, so I don't know if you
write more than that can be seen below.
>
> On 21 oct, 14:22, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>> hi, im using gwt 1.4.60 with eclipse.
>>
>> This is the code:
>>
>> final List list = question.getAnswers();
>> final ListIterator answersList = list.listIterator();
>> final int number = 37;
>> System.out.println("#1 ListIterator has next?: " +
>> answersList.hasNext());
>> System.out.println("#2 Number?: " + number);
>>
>> sendAnswer.addClickListener(new ClickListener() {
>> public void onClick(Widget sender) {
>> System.out.println("After clicking on the
>> button ...");
>> System.out.println("#3 ListIterator has next
>> inside the listener?:
>> " + answersList.hasNext());
>> System.out.println("#4 Number inside the
>> listener?: " + number);
>> }
>> });
>>
>> And this is the output:
>> #1 ListIterator has next?: true
>> #2 Number?: 37
>> After clicking on the button ...
>> #3 ListIterator has next inside the listener?: false
>> #4 Number inside the listener?: 37
>>
>> Why the number can be 'seen' inside the listener, but not the
>> Listener?
Do you call answerList.next() after the creation of the listener?
What happens if you create a new iterator inside the onClick-
method?
Regards, Lothar
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---