J
JavaEnquirer
I'm building an application whose Swing components should change in
response to application generated events e.g. someone clicks change
font size. This can be done quite easily by registering each component
with an EventManager ( my class ). When the application event triggers,
the EventManager iterates through it's list of Swing components and
modifies them. This works fine. However, is there a better technique?
For one, I'm worried about garbage collection i.e. if the EventManager
maintains a reference to a Swing component then it will never get
garbage collected. Is there anyway of knowing/trapping when a JButton
say is about to get collected?
many thanks in advance.
response to application generated events e.g. someone clicks change
font size. This can be done quite easily by registering each component
with an EventManager ( my class ). When the application event triggers,
the EventManager iterates through it's list of Swing components and
modifies them. This works fine. However, is there a better technique?
For one, I'm worried about garbage collection i.e. if the EventManager
maintains a reference to a Swing component then it will never get
garbage collected. Is there anyway of knowing/trapping when a JButton
say is about to get collected?
many thanks in advance.