Java Arena

Module 49

GUI: event handling

Windows that react. Event handlers for buttons with setOnAction and a lambda, reading text fields and changing labels in a handler, why a handler can't change a local variable and what to use instead, listeners that react to every change of a text field's text, switching buttons on and off, logic in a plain class that the handlers call, and launch parameters. MOOC sections 13.3 and 13.4.

Steps

  1. Buttons that do something
  2. Handlers that remember
  3. Reacting to typing
  4. Logic in a class of its own
  5. Launch parameters