I'm writing an app that schedules a list of jobs to be sent to a ray tracer
each job may take an hour or more
so, I have a list of jobs, I want to do them one at a time, not all together
the ray tracer gives info on what it's doing that I'd like to post to the GUI
so I loop through each job and create an instance of my class that extends SwingWorker
I'm using this code as an example
the second example, I'll post the code here for discussion
so far I can get it to post the messages from the ray tracer when it finishes the job but not as it goes along
so I'm here asking for an explanation of the example code and if I understand it correctly
first off, they pass textArea to task in it's constructor and task calls a function on it
I thought having the worker thread do this was a no no
second, what is the purpose of calling
it looks like that fires a PropertyChangeEvent causing the GUI thread to modify the progress bar
third, is the purpose of calling setProgress() to set the value that gets sent to the GUI in the PropertyChangeEvent?
and last, what's up with the overridden function process()?
isn't it writing to the GUI?
didn't we just do that with the publish() function?
sorry, I'm a bit confused here, are they showing me 2 different ways to do things?