= Scala Swing
{c}
<Scala Swing> provides <Scala> wrappers for <Java> Swing <graphical user interfaces>. Its notification mechanism implements an <observer pattern>: a publisher emits <software events>, and a reactor subscribes with `listenTo(publisher)`. Adding a handler to `reactions` supplies a <partial function> that matches the <software events> the reactor handles. Subscription and handling are distinct: one determines which publisher is heard, and the other determines what to do with a matching notification.<Scala Swing repository documentation>[README, Features and event-system description]{ref}
For example, a button publishes a button-click notification, and a subscribed display component handles it by updating a label. Another publisher's notifications need a subscription of their own. Calling `deafTo(publisher)` ends the subscription to that publisher without requiring removal of every handler.<Scala Swing Reactor API documentation>[Archived Scala 2.10.7 API, listenTo, deafTo and reactions]{ref}
Back to article page