java - JList is not updating correctly when action listner is a thread -


i have button actionlistener thread. within thread's run method try update jlist setlistdata() method , not update. worked combobox not jlist. tried doing in invokelater thread didn't work.

class main{      jbutton btn = new jbutton();      jlist jlist = new jlist();      btn.addactionlistern(new actionlistener(){          actionperformed(actionevent e){               new itthread().start();           }     });         class itthread extends thread{          run(){              string [] data = new string[2];              data[0] = "it"              data[1] ="itd";              jlist.setlistdata(data);         }     }   } 


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -