Posted By:
sky_fei
Posted On:
Sunday, December 15, 2002 07:32 PM
Hi, There is a swing application, in the application frame,the left is a tree,the right is the panel which shows information of the tree node. Now i want to refresh the tree node and right panel if it has something displayed in a cyclic time while user can do operation on the tree node or other operations in the gui. I have a global variable from which i decide whether i should send message to server to get the latest information,the variable i use in many places on my project. From the main frame to every gui. I know i must have a thread to do the auto-refresh but i want to know which should i use among the following methods: SwingWorker,Swing.Timer, Utilities.Timer or else? Though i have seen the examples of these m
More>>
Hi,
There is a swing application, in the application frame,the left is a tree,the right is the panel which shows information of the tree node.
Now i want to refresh the tree node and right panel if it has something displayed in a cyclic time while user can do operation on the tree node or other operations in the gui.
I have a global variable from which i decide whether i should send message to server to get the latest information,the variable i use in many places on my project.
From the main frame to every gui.
I know i must have a thread to do the auto-refresh but i want to know which should i use among the following methods: SwingWorker,Swing.Timer, Utilities.Timer or else?
Though i have seen the examples of these methods,I don't know clearly about how to do this without synchronized problem? I think my thread isn't the event-driven thread,should i use invokeLater or else?
Thx so much.
<<Less