Java JFrame closeWindow(final JFrame frame)

Here you can find the source of closeWindow(final JFrame frame)

Description

Send a WindowEvent#WINDOW_CLOSING event to the given window.

License

Open Source License

Declaration


static void closeWindow(final JFrame frame) 

Method Source Code

//package com.java2s;

import javax.swing.JFrame;
import java.awt.event.WindowEvent;

public class Main {
    /**/*from  w  w w .  j  a v a  2s .  com*/
     * Send a {@link WindowEvent#WINDOW_CLOSING} event to the given window.
     */

    static void closeWindow(final JFrame frame) {
        final WindowEvent ev = new WindowEvent(frame,
                WindowEvent.WINDOW_CLOSING);
        frame.dispatchEvent(ev);
    }
}

Related

  1. closeFrame(JFrame frame, JProgressBar progressBar)
  2. closeOnEsc(JFrame frame)
  3. closeOnEscape(final JFrame frame)
  4. closeOnEscape(final JFrame frame)
  5. closeOnKeyStroke(JFrame frame, KeyStroke keyStroke)
  6. configToApplicationFrame(JFrame frm)
  7. confirm(JFrame parent, String query, int type)
  8. createConfirmOnExitAdapter(final JFrame frame, final String title, final String message)
  9. createDialogForPanel(JFrame parent, JPanel panel)