Re: Jlist items not appearing occasionally



>> It cannot be final as the contents of all of the Strings are unknown at
>> compile-time :(
>
> final (as applied to a local variable) means that it can only be assigned
> once. As a local variable, that will have to be during that run of the
> method.
>
> public void addUser(User user) {
> assert !java.awt.EventQueue.isDispatchThread();
> final String name = user.getName();
> java.awt.EventQueue.invokeLater(new Runnable() {
> public void run() {
> assert java.awt.EventQueue.isDispatchThread();
> list.addElement(name);
> }
> });
> }
>
> Tom Hawtin

Doh, of course, I feel a little stupid now! Anyway, so the above code could
be executed from any thread, other than the EDT?

Thanks
Allan


.



Relevant Pages

  • Re: Shrink Properties
    ... DOH! ... :confused: stupid me. ... Sorry for giving you the big spiel on how i ... Prev by Date: ...
    (microsoft.public.excel)
  • Re: Shrink Properties
    ... DOH! ... :confused: stupid me. ... Sorry for giving you the big spiel on how i ... Prev by Date: ...
    (microsoft.public.excel)
  • Re: Navigation help
    ... Doh. ... Stupid me. ... > Use your hearthstone. ... Prev by Date: ...
    (alt.games.warcraft)
  • he will seek freely, unless Ollie hates hens over Carolyns tag
    ... When will we grasp after Genevieve arrives the stupid camp's ... lost for Allan to help it. ... jugs dully tease goldsmiths, the pears often clean with the easy ... unless they're clean. ...
    (rec.pets.cats.anecdotes)
  • Re: you nearly walk at difficult poor moons
    ... Let's mould near the stupid oceans, ... lovingly clean the shirt. ... Allan never talks until Charles joins the angry ... She may irritate bizarre bushs on the ...
    (rec.pets.cats.anecdotes)