D
David
Hi everyone,
I have already started programming an application with the following model:
I have a class A and a class B.
Where,
class B extends Thread, receives data from an external source at
undetermined intervals of time and interpretes this data.
Class A is a Swing GUI which has an object of class B. Class A has to get
data from class B in order to show it in the graphical objects. In fact,
I'm wondering how class A would manage to know when class B has data
ready? I was thinking about a tight loop in class B that polls the class
A object to know when data from the latter is available.
Is there some mechanism more appropriate? Any idea, url or reference
material will really help.
Thanking you for your attention,
David.
I have already started programming an application with the following model:
I have a class A and a class B.
Where,
class B extends Thread, receives data from an external source at
undetermined intervals of time and interpretes this data.
Class A is a Swing GUI which has an object of class B. Class A has to get
data from class B in order to show it in the graphical objects. In fact,
I'm wondering how class A would manage to know when class B has data
ready? I was thinking about a tight loop in class B that polls the class
A object to know when data from the latter is available.
Is there some mechanism more appropriate? Any idea, url or reference
material will really help.
Thanking you for your attention,
David.