java - Jprogress Bar and concurrency -
i know there have been tons of questions regarding this, , went through of them in past 2 hours looking working answer, none made it.
my dilemma making geocoder. program gui allows users chose excel file containing addresses read, , pressing button have new excel file created containing said data , latitude , longitude linked it. client run thousands of rows @ time why add progress bar instead of having program hanging. but, issue right expected, bar isn't updated until end.
now read swingworker can't seem how implement it. should actionperformed method nothing create new thread work done ? if how status of work goes ? confused right on issue , appreciate help.
thank you.
here have complete example understand how use swingworker
a basic example :
public class myswingworker extends swingworker<string,string> { @override public string doinbackground() { //here make heavy task in thread // call publish or setprogress or both } @override protected void done() { //here call when job done, can update here gui } public void process(list<string> chunks){ // called when publish in background here // update gui } } you execute method in actionperformed if want myswingworker.execute()
Comments
Post a Comment