model view control & JProgressBar

hello,

I didn't understand to handle with the Progressbar.

For example when want to represent the download of a file:

I have a class TransferE (Entity), which does the transfer of the file

I have a class TransferUI (User Interface) for the user interface

I have a class TransferC (Control) between ui and entity

now how to update the progressbar?

The download need to run in an own Thread i think.

Do I have to run an extra Thread in the UI to get the status in a specified interval?

Or can I give the ProgressBar to the Entityclass as parameter, so that the bar will be updated in the entity's run()-method?

cheers

Tobias

[697 byte] By [t.k.k.a] at [2007-9-29 12:25:55]
# 1
Try this tutorial... http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html
pipzenoa at 2007-7-15 2:17:34 > top of Java-index,Other Topics,Patterns & OO Design...
# 2

Hi, I had a similar question/problem. its not that i don't know how to use a progress bar (or maybe i don't), its more an issue of design. if we pass the progress bar to an entity or control class then we are mixing interface code with entity or control code. after all these two do not need to know the progress of their methods. its seems that which ever way it is done when we use progress bars, this problem arises. i wonder if there is a way to find out whether a method has completed or not just by its execution

gpathman1a at 2007-7-15 2:17:34 > top of Java-index,Other Topics,Patterns & OO Design...