[brailleblaster] Re: How do I get this notifyListeners addListener to work

  • From: Richard Baldwin <baldwin@xxxxxxxxxxxxxxx>
  • To: brailleblaster@xxxxxxxxxxxxx
  • Date: Thu, 16 Jun 2011 11:20:44 -0500

By the way, there are two different issues involved.

The first issue is to understand the event handling mechanism in general.

The second issue is to understand the very cryptic syntax involved with the
use of "anonymous" listener classes, if you elect to go that route.

If that second part becomes a problem, let me know and I can probably
provide a relatively simple example (using standard AWT or Swing components)
along with the words necessary to cause it to make sense.

Dick B.

On Thu, Jun 16, 2011 at 11:16 AM, Richard Baldwin
<baldwin@xxxxxxxxxxxxxxx>wrote:

> I'm not certain that it is exactly the same with SWT, but this is the
> "official" Sun approach to event handling in Java.
>
> Dick B.
>
>
> On Thu, Jun 16, 2011 at 11:13 AM, John J. Boyer <
> john.boyer@xxxxxxxxxxxxxxxxx> wrote:
>
>> Dick,
>>
>> Thanks. This might help me understand the event-listener mechanism.
>>
>> John
>>
>> On Thu, Jun 16, 2011 at 09:50:29AM -0500, Richard Baldwin wrote:
>> > See http://www.dickbaldwin.com/java/Java080.htm and the next three or
>> four
>> > lessons following lesson 80 at http://www.dickbaldwin.com/tocmed.htmfor
>> > more information on the Java source-listener event model.
>> >
>> > Dick Baldwin
>> >
>> > On Thu, Jun 16, 2011 at 9:27 AM, Susan Jolly <easjolly@xxxxxxxxxxxxx>
>> wrote:
>> >
>> > > There are two actors involved in listening: the listener and the what
>> I'll
>> > > call the broadcaster. GUI components have built-in logic to broadcast
>> > > certain events in response to certain user actions.  MenuItems, for
>> example,
>> > > have logic to broadcast the event that they've been selected. Other
>> GUI
>> > > components have logic to broadcast other types of events.
>> > >
>> > > When an object registers itself as a listener for an event it does
>> this by
>> > > asking an appropriate GUI component to add it as a one of its
>> listeners for
>> > > a specific type of event.  This only works if that GUI was already set
>> up to
>> > > broadcast that event.  A GUI's API will tell you what events it is
>> designed
>> > > broadcast.
>> > >
>> > > HTH,
>> > > Susan
>> > >
>> > >
>> >
>> >
>> > --
>> > Richard G. Baldwin (Dick Baldwin)
>> > Home of Baldwin's on-line Java Tutorials
>> > http://www.DickBaldwin.com
>> >
>> > Professor of Computer Information Technology
>> > Austin Community College
>> > (512) 223-4758
>> > mailto:Baldwin@xxxxxxxxxxxxxxx
>> > http://www.austincc.edu/baldwin/
>>
>> --
>> John J. Boyer; President, Chief Software Developer
>> Abilitiessoft, Inc.
>> http://www.abilitiessoft.com
>> Madison, Wisconsin USA
>> Developing software for people with disabilities
>>
>>
>>
>
>
> --
> Richard G. Baldwin (Dick Baldwin)
> Home of Baldwin's on-line Java Tutorials
> http://www.DickBaldwin.com
>
> Professor of Computer Information Technology
> Austin Community College
> (512) 223-4758
> mailto:Baldwin@xxxxxxxxxxxxxxx
> http://www.austincc.edu/baldwin/
>



-- 
Richard G. Baldwin (Dick Baldwin)
Home of Baldwin's on-line Java Tutorials
http://www.DickBaldwin.com

Professor of Computer Information Technology
Austin Community College
(512) 223-4758
mailto:Baldwin@xxxxxxxxxxxxxxx
http://www.austincc.edu/baldwin/

Other related posts: