Docs

Documentation versions (currently viewingVaadin 25.4 (pre-release))

Add Listeners

Add a click, focus, or other listener to a component, and write its code in your IDE.

To make a component do something, add a listener to it. Copilot writes the stub, and your IDE opens at it, ready for the code.

Add a click listener to a button
  1. Right-click a component, point at Add Listener, and choose one, here Add Click Listener.

  2. Copilot adds the listener to ContactView.java, and your IDE opens at it.

Your IDE opens at the listener when you have the Vaadin plugin for your IDE. See IDE Integration.