Class ExitOnWindowClosingListener

java.lang.Object
java.awt.event.WindowAdapter
megameklab.ui.util.ExitOnWindowClosingListener
All Implemented Interfaces:
WindowFocusListener, WindowListener, WindowStateListener, EventListener

public final class ExitOnWindowClosingListener extends WindowAdapter
This is a specific WindowAdapter that acts on a windowClosing event by calling the given AppCloser's exit() method and exits the application if exit() returned true. Add this to any Frame that should exit the application by closing its window.
  • Constructor Details

    • ExitOnWindowClosingListener

      public ExitOnWindowClosingListener(AppCloser frame)
      Returns a new window listener for the given frame that will react to windowClosing events by calling the frame's exit() method and closing the application when exit() returns true.
      Parameters:
      frame - The frame (implementing AppCloser) that this window listener is for
  • Method Details