in application have created multiple threads, in in each thread value has been changed. every minute want update threads same value list..in coding, values not updated. previous values retained in every thread. solution?
public static class updateclient implements runnable { public static void doupadte(map<string, string> list) { final map<string, string> lihashmap = list; swingutilities.invokelater(new runnable() { @override public void run() { // todo auto-generated method stub (entry<string, string> entry : lihashmap.entryset()) { string client_name=entry.getkey(); tanames.append(client_name + "\n"); } } }); } @override public void run() { // todo auto-generated method stub while(true) { try { thread.sleep(5000); doupadte(list); } catch (exception e) { // todo: handle exception e.printstacktrace(); } } } }
Comments
Post a Comment