ActionListener
ActionListener is an interface in the Java programming language, part of the AWT and Swing event models, used to receive action events fired by user interface components such as buttons and menu items. It defines a single method, actionPerformed(ActionEvent e). Implementations register with components using addActionListener; for example, a JButton can accept listeners that respond when the button is pressed. When the user activates the component, the component creates an ActionEvent and dispatches it to all registered listeners by invoking their actionPerformed methods.
ActionEvent, defined in java.awt.event, provides information about the event, including the event source, an action command
ActionListener is a functional interface, so it can be implemented with a lambda expression in Java 8
Best practices include keeping the event-handling code short and performing long-running tasks outside the Event Dispatch