[Swing] how to relay events to other components

From: T E Schmitz (nospam_at_nowhere.com)
Date: 04/21/04


Date: Wed, 21 Apr 2004 11:13:56 +0100

Hello,

I would like to achieve the following:

Scenario:
Component A notifies component B about an event e1. B knows that there
are are various other components interested to know about this event. Is
it possible for B to relay this event to components C,D,+E? Or do C,D+E
have to be registered as listeners with A in the first place?
Also, another type of event e2 will cause the same action in C,D+E.
A doesn't [need to] know about C,D+E.
C,D+E don't care whether e1 or e2 trigger of the action.

Example:
Tabbed pane: When a tab comes to the front the data need to be refreshed
from the datastore. The panel associated with the tab contains several
"sub-panels", which are implemented as separate classes. They don't care
what the source of the event was. All they need is a trigger to refresh
themselves.

Only solution I can think of:
B provides A with a list of listeners collected from C,D+E.

Maybe I am just overlooking the blindingly obvious.

-- 
Regards,
Tarlika Elisabeth Schmitz


Relevant Pages

  • [Swing] how to relay events to other components
    ... C,D+E don't care whether e1 or e2 trigger of the action. ... Tabbed pane: When a tab comes to the front the data need to be refreshed ... All they need is a trigger to refresh ...
    (comp.lang.java.gui)
  • Re: TRIGGER (AFTER INSERT) and Store Procedure ... insert failed !
    ... >into SQL server, the record exist anyway! ... >If you refresh the data you will see the record... ... it gets refreshed after trigger excecution automatically. ... I don't know your monitoring system, but I guess that removing the result ...
    (microsoft.public.sqlserver.programming)
  • [patch 01/15] x86-64: Fix "bytes left to copy" return value for copy_from_user()
    ... Most users by far do not care about the exact return value (they only ... And the unrolled versions of the x86-64 user copy routines would ... this bug even harder to trigger, most x86 CPU's use the "rep string" ... behavior down to commit 08291429cfa6258c4cd95d8833beb40f828b194e ("mm: ...
    (Linux-Kernel)
  • Re: Idea for new ttk Notebook virtual event
    ... approach - you may have gathered by now that your refresh via tab click ... ...And I like the "click any tab to see the current data" idea. ... displayed pane, would be ok - but if I want to use notebook tabs it ... the notebooks using a common refresh) - the whole display will become ...
    (comp.lang.tcl)
  • Re: Calculated fields in subforms of Tab Control not refreshing
    ... Perhaps you need to force the ReCalc in a particular order. ... calculates correctly when I use the refresh function from the menu. ... the pages of the tab control as you expect. ... Calculations in some fields use data from fields in other ...
    (microsoft.public.access.modulesdaovba)

Loading