[thelist] Java classes and events

David Treves dwork at macam.ac.il
Thu Jan 9 07:51:01 CST 2003


Hi Kevin,

Use Observer/Observable design. You may read about it in JavaDocs. The basic
idea is that one object is the observable and it notifies all observers when
some event occurs.

Check out:

Observer Interface:
http://java.sun.com/j2se/1.4.1/docs/api/java/util/Observer.html
Observable Class:
http://java.sun.com/j2se/1.4.1/docs/api/java/util/Observable.html

HTH,
David Travis.


----- Original Message -----
From: "Kevin W" <null at tsn.cc>
To: <thelist at lists.evolt.org>
Sent: Thursday, January 09, 2003 10:05 AM
Subject: [thelist] Java classes and events


> Not sure if this is on topic here, but...
> I've got a JFrame object "gameWindow" that creates a JPanel object
"board".
>  board invokes and receives an ActionEvent.  board processes the
> ActionEvent.
>
> Is there any way for board to let gameWindow know about the event as well?
> Or do I have to make gameWindow check continually for a board variable to
> change?
>
> --
> Kevin W :-)
> --
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !




More information about the thelist mailing list