Java Code Examples for javax.swing.event.InternalFrameEvent#INTERNAL_FRAME_CLOSING

The following examples show how to use javax.swing.event.InternalFrameEvent#INTERNAL_FRAME_CLOSING . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SeaGlassInternalFrameTitlePane.java    From seaglass with Apache License 2.0 6 votes vote down vote up
/**
 * Post a WINDOW_CLOSING-like event to the frame, so that it can be treated
 * like a regular Frame.
 *
 * @param frame the internal frame to be closed.
 */
protected void postClosingEvent(JInternalFrame frame) {
    InternalFrameEvent e = new InternalFrameEvent(frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);

    // Try posting event, unless there's a SecurityManager.
    if (JInternalFrame.class.getClassLoader() == null) {

        try {
            Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);

            return;
        } catch (SecurityException se) {
            // Use dispatchEvent instead.
        }
    }

    frame.dispatchEvent(e);
}
 
Example 2
Source File: BasicInternalFrameTitlePane.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Post a WINDOW_CLOSING-like event to the frame, so that it can
 * be treated like a regular Frame.
 */
protected void postClosingEvent(JInternalFrame frame) {
    InternalFrameEvent e = new InternalFrameEvent(
        frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
    // Try posting event, unless there's a SecurityManager.
    try {
        Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
    } catch (SecurityException se) {
        frame.dispatchEvent(e);
    }
}
 
Example 3
Source File: BasicInternalFrameTitlePane.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Post a WINDOW_CLOSING-like event to the frame, so that it can
 * be treated like a regular Frame.
 */
protected void postClosingEvent(JInternalFrame frame) {
    InternalFrameEvent e = new InternalFrameEvent(
        frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
    // Try posting event, unless there's a SecurityManager.
    try {
        Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
    } catch (SecurityException se) {
        frame.dispatchEvent(e);
    }
}
 
Example 4
Source File: BasicInternalFrameTitlePane.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Post a WINDOW_CLOSING-like event to the frame, so that it can
 * be treated like a regular Frame.
 */
protected void postClosingEvent(JInternalFrame frame) {
    InternalFrameEvent e = new InternalFrameEvent(
        frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
    // Try posting event, unless there's a SecurityManager.
    try {
        Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
    } catch (SecurityException se) {
        frame.dispatchEvent(e);
    }
}
 
Example 5
Source File: BasicInternalFrameTitlePane.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Post a WINDOW_CLOSING-like event to the frame, so that it can
 * be treated like a regular Frame.
 */
protected void postClosingEvent(JInternalFrame frame) {
    InternalFrameEvent e = new InternalFrameEvent(
        frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
    // Try posting event, unless there's a SecurityManager.
    try {
        Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
    } catch (SecurityException se) {
        frame.dispatchEvent(e);
    }
}
 
Example 6
Source File: BasicInternalFrameTitlePane.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Post a WINDOW_CLOSING-like event to the frame, so that it can
 * be treated like a regular Frame.
 */
protected void postClosingEvent(JInternalFrame frame) {
    InternalFrameEvent e = new InternalFrameEvent(
        frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
    // Try posting event, unless there's a SecurityManager.
    if (JInternalFrame.class.getClassLoader() == null) {
        try {
            Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
            return;
        } catch (SecurityException se) {
            // Use dispatchEvent instead.
        }
    }
    frame.dispatchEvent(e);
}
 
Example 7
Source File: BasicInternalFrameTitlePane.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Post a WINDOW_CLOSING-like event to the frame, so that it can
 * be treated like a regular Frame.
 */
protected void postClosingEvent(JInternalFrame frame) {
    InternalFrameEvent e = new InternalFrameEvent(
        frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
    // Try posting event, unless there's a SecurityManager.
    if (JInternalFrame.class.getClassLoader() == null) {
        try {
            Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
            return;
        } catch (SecurityException se) {
            // Use dispatchEvent instead.
        }
    }
    frame.dispatchEvent(e);
}
 
Example 8
Source File: BasicInternalFrameTitlePane.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Post a WINDOW_CLOSING-like event to the frame, so that it can
 * be treated like a regular Frame.
 */
protected void postClosingEvent(JInternalFrame frame) {
    InternalFrameEvent e = new InternalFrameEvent(
        frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
    // Try posting event, unless there's a SecurityManager.
    try {
        Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
    } catch (SecurityException se) {
        frame.dispatchEvent(e);
    }
}
 
Example 9
Source File: BasicInternalFrameTitlePane.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
/**
 * Post a WINDOW_CLOSING-like event to the frame, so that it can
 * be treated like a regular Frame.
 */
protected void postClosingEvent(JInternalFrame frame) {
    InternalFrameEvent e = new InternalFrameEvent(
        frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
    // Try posting event, unless there's a SecurityManager.
    try {
        Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
    } catch (SecurityException se) {
        frame.dispatchEvent(e);
    }
}
 
Example 10
Source File: BasicInternalFrameTitlePane.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Post a WINDOW_CLOSING-like event to the frame, so that it can
 * be treated like a regular Frame.
 */
protected void postClosingEvent(JInternalFrame frame) {
    InternalFrameEvent e = new InternalFrameEvent(
        frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
    // Try posting event, unless there's a SecurityManager.
    try {
        Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
    } catch (SecurityException se) {
        frame.dispatchEvent(e);
    }
}
 
Example 11
Source File: BasicInternalFrameTitlePane.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Post a WINDOW_CLOSING-like event to the frame, so that it can
 * be treated like a regular {@code Frame}.
 *
 * @param frame an instance of {@code JInternalFrame}
 */
protected void postClosingEvent(JInternalFrame frame) {
    InternalFrameEvent e = new InternalFrameEvent(
        frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
    // Try posting event, unless there's a SecurityManager.
    try {
        Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
    } catch (SecurityException se) {
        frame.dispatchEvent(e);
    }
}
 
Example 12
Source File: BasicInternalFrameTitlePane.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Post a WINDOW_CLOSING-like event to the frame, so that it can
 * be treated like a regular {@code Frame}.
 *
 * @param frame an instance of {@code JInternalFrame}
 */
protected void postClosingEvent(JInternalFrame frame) {
    InternalFrameEvent e = new InternalFrameEvent(
        frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
    // Try posting event, unless there's a SecurityManager.
    try {
        Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
    } catch (SecurityException se) {
        frame.dispatchEvent(e);
    }
}
 
Example 13
Source File: BasicInternalFrameTitlePane.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Post a WINDOW_CLOSING-like event to the frame, so that it can
 * be treated like a regular Frame.
 */
protected void postClosingEvent(JInternalFrame frame) {
    InternalFrameEvent e = new InternalFrameEvent(
        frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
    // Try posting event, unless there's a SecurityManager.
    try {
        Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
    } catch (SecurityException se) {
        frame.dispatchEvent(e);
    }
}
 
Example 14
Source File: BasicInternalFrameTitlePane.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Post a WINDOW_CLOSING-like event to the frame, so that it can
 * be treated like a regular Frame.
 */
protected void postClosingEvent(JInternalFrame frame) {
    InternalFrameEvent e = new InternalFrameEvent(
        frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
    // Try posting event, unless there's a SecurityManager.
    try {
        Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
    } catch (SecurityException se) {
        frame.dispatchEvent(e);
    }
}
 
Example 15
Source File: BasicInternalFrameTitlePane.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Post a WINDOW_CLOSING-like event to the frame, so that it can
 * be treated like a regular Frame.
 */
protected void postClosingEvent(JInternalFrame frame) {
    InternalFrameEvent e = new InternalFrameEvent(
        frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
    // Try posting event, unless there's a SecurityManager.
    try {
        Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
    } catch (SecurityException se) {
        frame.dispatchEvent(e);
    }
}
 
Example 16
Source File: BasicInternalFrameTitlePane.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Post a WINDOW_CLOSING-like event to the frame, so that it can
 * be treated like a regular Frame.
 */
protected void postClosingEvent(JInternalFrame frame) {
    InternalFrameEvent e = new InternalFrameEvent(
        frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
    // Try posting event, unless there's a SecurityManager.
    try {
        Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
    } catch (SecurityException se) {
        frame.dispatchEvent(e);
    }
}
 
Example 17
Source File: BasicInternalFrameTitlePane.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Post a WINDOW_CLOSING-like event to the frame, so that it can
 * be treated like a regular Frame.
 */
protected void postClosingEvent(JInternalFrame frame) {
    InternalFrameEvent e = new InternalFrameEvent(
        frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
    // Try posting event, unless there's a SecurityManager.
    try {
        Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
    } catch (SecurityException se) {
        frame.dispatchEvent(e);
    }
}
 
Example 18
Source File: BasicInternalFrameTitlePane.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Post a WINDOW_CLOSING-like event to the frame, so that it can
 * be treated like a regular Frame.
 */
protected void postClosingEvent(JInternalFrame frame) {
    InternalFrameEvent e = new InternalFrameEvent(
        frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
    // Try posting event, unless there's a SecurityManager.
    try {
        Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
    } catch (SecurityException se) {
        frame.dispatchEvent(e);
    }
}