Solution (source code)

= Solution

Inside the supplied `MainFrame`, after both buttons and the label are defined, add:
``
private var clickCount = BigInt(0)
listenTo(button1, button2)
reactions += {
  case ButtonClicked(source) if (source eq button1) || (source eq button2) =>
    clickCount += 1
    label.text = "Total button clicks: " + clickCount.toString
}
``
The <invariant> is that `clickCount` equals the total number of handled click events from the two buttons. It starts at zero; each matching event increments it exactly once and refreshes the label. The buttons' existing self-listeners can still change their own text independently. \b[Listening to both publishers is necessary]: their `listenTo(this)` calls subscribe each button to itself, not the frame to both buttons. Updating the label is not another button click, so it does not recursively increment the counter. An <arbitrary-precision integer> keeps the count exact without a lifetime overflow bound.<Scala Swing event-system documentation>[Publisher/Reactor subscriptions, listenTo, and reactions; ButtonClicked source event]{ref}

The supplied layout already contains the label, so no additional component is needed. Before any click it retains its initial zero-click message; afterwards it displays the cumulative count across both buttons.