Example usage for javax.swing JFrame setModalExclusionType

List of usage examples for javax.swing JFrame setModalExclusionType

Introduction

In this page you can find the example usage for javax.swing JFrame setModalExclusionType.

Prototype

public void setModalExclusionType(Dialog.ModalExclusionType exclusionType) 

Source Link

Document

Specifies the modal exclusion type for this window.

Usage

From source file:ApplicationModalDialogWithExcludeDemo.java

public static void main(String[] args) {
    final JFrame parent1 = new JFrame("Parent Frame 1");
    parent1.setLayout(new FlowLayout());
    parent1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    parent1.setBounds(100, 100, 200, 150);
    parent1.setVisible(true);/*from  w  ww.  ja v  a 2s .c o m*/

    JFrame parent2 = new JFrame("Parent Frame 2");
    parent2.setBounds(500, 100, 300, 150);
    parent2.setVisible(true);

    JFrame parent3 = new JFrame("Parent Frame 3 - Excluded");
    parent3.setBounds(300, 400, 300, 150);
    parent3.setModalExclusionType(Dialog.ModalExclusionType.APPLICATION_EXCLUDE);
    parent3.setVisible(true);

    JDialog dialog = new JDialog(parent1, "Application-Modal Dialog", Dialog.ModalityType.APPLICATION_MODAL);
    dialog.setBounds(300, 200, 300, 150);
    dialog.setVisible(true);

}