Example usage for javax.swing WindowConstants DISPOSE_ON_CLOSE

List of usage examples for javax.swing WindowConstants DISPOSE_ON_CLOSE

Introduction

In this page you can find the example usage for javax.swing WindowConstants DISPOSE_ON_CLOSE.

Prototype

int DISPOSE_ON_CLOSE

To view the source code for javax.swing WindowConstants DISPOSE_ON_CLOSE.

Click Source Link

Document

The dispose-window default window close operation.

Usage

From source file:gtu._work.ui.LogAppendStartEndUI.java

private void initGUI() {
    try {//  www. j av a2 s  .c  o  m
        BorderLayout thisLayout = new BorderLayout();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(thisLayout);
        {
            jTabbedPane1 = new JTabbedPane();
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            {
                jPanel1 = new JPanel();
                GridLayout jPanel1Layout = new GridLayout(10, 1);
                jPanel1.setLayout(jPanel1Layout);
                jTabbedPane1.addTab("jPanel1", null, jPanel1, null);
                {
                    jLabel1 = new JLabel();
                    jPanel1.add(jLabel1);
                    jLabel1.setText("java\u6a94");
                }
                {
                    javaSrcFileText = new JTextField();
                    jPanel1.add(javaSrcFileText);
                    JCommonUtil.jTextFieldSetFilePathMouseEvent(javaSrcFileText, false);
                }
                {
                    jLabel2 = new JLabel();
                    jPanel1.add(jLabel2);
                    jLabel2.setText("method\u958b\u59cb");
                }
                {
                    methodStartText = new JTextField();
                    methodStartText.setText("\"#. ${method} .s\"");
                    jPanel1.add(methodStartText);
                }
                {
                    jLabel3 = new JLabel();
                    jPanel1.add(jLabel3);
                    jLabel3.setText("method\u7d50\u675f");
                }
                {
                    methodEndText = new JTextField();
                    methodEndText.setText("\"#. ${method} .e\"");
                    jPanel1.add(methodEndText);
                }
                {
                    jLabel4 = new JLabel();
                    jPanel1.add(jLabel4);
                    jLabel4.setText(
                            "\u7528\u684c\u9762\u8a2d\u5b9a\u6a94\u6c7a\u5b9adebug\u958b\u8d77\u6216\u95dc\u9589");
                }
                {
                    ComboBoxModel onOffDebugSwitchComboBoxModel = new DefaultComboBoxModel(
                            new String[] { "false", "true" });
                    onOffDebugSwitchComboBox = new JComboBox();
                    jPanel1.add(onOffDebugSwitchComboBox);
                    onOffDebugSwitchComboBox.setModel(onOffDebugSwitchComboBoxModel);
                }
                {
                    executeBtn = new JButton();
                    jPanel1.add(executeBtn);
                    executeBtn.setText("\u57f7\u884c");
                    executeBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            executeBtnActionPerformed(evt);
                        }
                    });
                }
            }
        }
        pack();
        this.setSize(587, 404);
    } catch (Exception e) {
        //add your error handling code here
        e.printStackTrace();
    }
}

From source file:com.mirth.connect.connectors.file.AdvancedSftpSettingsDialog.java

public AdvancedSftpSettingsDialog(SftpSchemeProperties schemeProperties) {
    setTitle("Method Settings");
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    setSize(new Dimension(600, 400));
    setResizable(false);//from w  w w. j a  v a  2 s. c o  m
    setLayout(new MigLayout("insets 8 8 0 8, novisualpadding, hidemode 3"));
    getContentPane().setBackground(UIConstants.BACKGROUND_COLOR);

    initComponents();
    initLayout();

    setFileSchemeProperties(schemeProperties);

    keyLocationField.setBackground(null);
    knownHostsField.setBackground(null);
    setLocationRelativeTo(PlatformUI.MIRTH_FRAME);
    setVisible(true);
}

From source file:ComponentFrame.java

/**
 * creates the frame with the given name
 * @param what   the component to display
 * @param name   the name of the Frame/*w  ww  . ja  v  a  2 s  .co m*/
 */
public ComponentFrame(Component what, String name) {
    super(name);

    // make sure that we close and dispose ourselves when needed
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

    // default size of the frame
    setSize(700, 600);

    // we want to display just the component in the entire frame
    if (what != null) {
        getContentPane().add("Center", what);
    }
}

From source file:org.interpss.chart.dstab.SimpleOneStateChart.java

/**
 * A demonstration application showing an {@link XYSeries} where all the y-values are the same.
 *
 * @param parent /* w  w  w  . jav  a  2 s  . c  om*/
 * @param model  
 * @param title  
 */
public SimpleOneStateChart(java.awt.Frame parent, boolean modal, final String title) {
    super(parent, modal);
    setTitle("Transient Stability Curve Plotting");
    setPlotTitle(title);
    this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
}

From source file:org.interpss.chart.dist.LoadScheduleChart.java

/**
 * A demonstration application showing an {@link XYSeries} where all the y-values are the same.
 *
 * @param title  the frame title.//from   w w w .  j a va 2 s. c  o  m
 */
public LoadScheduleChart(final String title) {
    super(title);
    this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
}

From source file:eu.lp0.cursus.ui.AboutDialog.java

private void initialise() {
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    setTitle(Messages.getString("about.title", Constants.APP_DESC)); //$NON-NLS-1$
    DefaultUnitConverter duc = DefaultUnitConverter.getInstance();

    FormLayout layout = new FormLayout("2dlu, pref, fill:pref:grow, max(30dlu;pref), 2dlu", //$NON-NLS-1$
            "2dlu, max(15dlu;pref), 2dlu, max(15dlu;pref), 2dlu, fill:max(100dlu;pref):grow, 2dlu, max(16dlu;pref), 2dlu"); //$NON-NLS-1$
    getContentPane().setLayout(layout);//from  w w  w  . java  2 s. c om

    JLabel lblName = new JLabel(Constants.APP_NAME + ": " + Messages.getString("about.description")); //$NON-NLS-1$ //$NON-NLS-2$
    getContentPane().add(lblName, "2, 2, 3, 1"); //$NON-NLS-1$

    getContentPane().add(new LinkJButton(Constants.APP_URL), "2, 4"); //$NON-NLS-1$

    JScrollPane scrCopying = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    getContentPane().add(scrCopying, "2, 6, 3, 1"); //$NON-NLS-1$

    JTextArea txtCopying = new JTextArea(loadResources("COPYRIGHT", "LICENCE")); //$NON-NLS-1$ //$NON-NLS-2$
    txtCopying.setFont(Font.decode(Font.MONOSPACED));
    txtCopying.setEditable(false);
    scrCopying.setViewportView(txtCopying);
    scrCopying.setPreferredSize(
            new Dimension(scrCopying.getPreferredSize().width, duc.dialogUnitYAsPixel(100, scrCopying)));

    Action actClose = new CloseDialogAction(this);
    JButton btnClose = new JButton(actClose);
    getContentPane().add(btnClose, "4, 8"); //$NON-NLS-1$

    getRootPane().setDefaultButton(btnClose);
    getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
            .put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), CloseDialogAction.class.getName());
    getRootPane().getActionMap().put(CloseDialogAction.class.getName(), actClose);

    pack();
    setMinimumSize(getSize());
    setSize(getSize().width, getSize().height * 3 / 2);
    btnClose.requestFocusInWindow();
}

From source file:gtu._work.ui.StringArrayMakerUI.java

private void initGUI() {
    try {/*from ww w.j av a  2  s .  c o m*/
        BorderLayout thisLayout = new BorderLayout();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(thisLayout);
        {
            jTabbedPane1 = new JTabbedPane();
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            {
                jPanel1 = new JPanel();
                BorderLayout jPanel1Layout = new BorderLayout();
                jPanel1.setLayout(jPanel1Layout);
                jTabbedPane1.addTab("jPanel1", null, jPanel1, null);
                {
                    jScrollPane2 = new JScrollPane();
                    jPanel1.add(jScrollPane2, BorderLayout.CENTER);
                    jScrollPane2.setPreferredSize(new java.awt.Dimension(525, 267));
                    {
                        ListModel jList1Model = new DefaultListModel();
                        jList1 = new JList();

                        jScrollPane2.setViewportView(jList1);
                        jList1.addKeyListener(new KeyAdapter() {
                            public void keyPressed(KeyEvent evt) {
                                JListUtil.newInstance(jList1).defaultJListKeyPressed(evt);
                            }
                        });
                        jList1.setModel(jList1Model);
                    }
                }
                {
                    jButton1 = new JButton();
                    jPanel1.add(jButton1, BorderLayout.NORTH);
                    jButton1.setText("\u8cbc\u4e0a");
                    jButton1.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            jButton1ActionPerformed(evt);
                        }
                    });
                }
                {
                    jPanel3 = new JPanel();
                    FlowLayout jPanel3Layout = new FlowLayout();
                    jPanel3Layout.setAlignment(FlowLayout.RIGHT);
                    jPanel1.add(jPanel3, BorderLayout.WEST);
                    jPanel3.setLayout(jPanel3Layout);
                    jPanel3.setPreferredSize(new java.awt.Dimension(50, 291));
                    {
                        jCheckBox1 = new JCheckBox();
                        jPanel3.add(jCheckBox1);
                        jCheckBox1.setText("\\n");
                    }
                    {
                        jCheckBox2 = new JCheckBox();
                        jPanel3.add(jCheckBox2);
                        jCheckBox2.setText("\\t");
                    }
                }
            }
            {
                jPanel2 = new JPanel();
                BorderLayout jPanel2Layout = new BorderLayout();
                jPanel2.setLayout(jPanel2Layout);
                jTabbedPane1.addTab("jPanel2", null, jPanel2, null);
                {
                    jButton2 = new JButton();
                    jPanel2.add(jButton2, BorderLayout.NORTH);
                    jButton2.setText("\u7522\u751f");
                    jButton2.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            jButton2ActionPerformed(evt);
                        }
                    });
                }
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel2.add(jScrollPane1, BorderLayout.CENTER);
                    jScrollPane1.setPreferredSize(new java.awt.Dimension(525, 291));
                    {
                        jTextArea1 = new JTextArea();
                        jScrollPane1.setViewportView(jTextArea1);
                        jTextArea1.setText("");
                    }
                }
            }
        }
        pack();
        this.setSize(546, 382);
    } catch (Exception e) {
        // add your error handling code here
        e.printStackTrace();
    }
}

From source file:com.mirth.connect.client.ui.attachments.RegexAttachmentDialog.java

public RegexAttachmentDialog(AttachmentHandlerProperties properties) {
    super(PlatformUI.MIRTH_FRAME, true);
    this.parent = PlatformUI.MIRTH_FRAME;

    setTitle("Set Attachment Properties");
    getContentPane().setBackground(UIConstants.BACKGROUND_COLOR);
    setLayout(new MigLayout("novisualpadding, hidemode 3, insets 12", "[fill, grow]"));
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    setPreferredSize(new Dimension(650, 550));

    initComponents();/*from   w  w  w.ja  va 2s  .  c o  m*/
    initLayout();
    initInboundReplacementTable();
    initOutboundReplacementTable();

    attachmentHandlerProperties = properties;

    List<RegexInfo> regexInfoList = new ArrayList<RegexInfo>();

    if (attachmentHandlerProperties.getProperties().containsKey("regex.pattern")) {
        String regex = StringUtils
                .defaultString(attachmentHandlerProperties.getProperties().get("regex.pattern"));
        String mimeType = StringUtils
                .defaultString(attachmentHandlerProperties.getProperties().get("regex.mimetype"));
        regexInfoList.add(new RegexInfo(regex, mimeType));
    }

    int count = 0;
    while (attachmentHandlerProperties.getProperties().containsKey("regex.pattern" + count)) {
        String regex = StringUtils
                .defaultString(attachmentHandlerProperties.getProperties().get("regex.pattern" + count));
        String mimeType = StringUtils
                .defaultString(attachmentHandlerProperties.getProperties().get("regex.mimetype" + count));
        regexInfoList.add(new RegexInfo(regex, mimeType));
        count++;
    }

    Object[][] regexTableData = new Object[regexInfoList.size()][2];
    int i = 0;
    for (RegexInfo regexInfo : regexInfoList) {
        regexTableData[i][0] = regexInfo.pattern;
        regexTableData[i][1] = regexInfo.mimeType;
        i++;
    }
    ((RefreshTableModel) regexTable.getModel()).refreshDataVector(regexTableData);

    count = 0;
    while (attachmentHandlerProperties.getProperties().containsKey("regex.replaceKey" + count)) {
        DefaultTableModel tableModel = (DefaultTableModel) inboundReplacementTable.getModel();
        tableModel.addRow(
                new Object[] { attachmentHandlerProperties.getProperties().get("regex.replaceKey" + count),
                        attachmentHandlerProperties.getProperties().get("regex.replaceValue" + count) });
        count++;
    }

    count = 0;
    while (attachmentHandlerProperties.getProperties().containsKey("outbound.regex.replaceKey" + count)) {
        DefaultTableModel tableModel = (DefaultTableModel) outboundReplacementTable.getModel();
        tableModel.addRow(new Object[] {
                attachmentHandlerProperties.getProperties().get("outbound.regex.replaceKey" + count),
                attachmentHandlerProperties.getProperties().get("outbound.regex.replaceValue" + count) });
        count++;
    }

    setLocationRelativeTo(parent);
    setVisible(true);
}

From source file:gtu._work.ui.RetryByPassUI.java

private void initGUI() {
    try {/*  w  w w .j a va  2  s.co  m*/
        BorderLayout thisLayout = new BorderLayout();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(thisLayout);
        {
            jTabbedPane1 = new JTabbedPane();
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            {
                jPanel1 = new JPanel();
                FlowLayout jPanel1Layout = new FlowLayout();
                jPanel1.setLayout(jPanel1Layout);
                jTabbedPane1.addTab("?", null, jPanel1, null);
                {
                    DefaultComboBoxModel countryComboBoxModel = new DefaultComboBoxModel();
                    for (CountyEnum e : CountyEnum.values()) {
                        countryComboBoxModel.addElement(e.countyLabel);
                    }
                    countryComboBox = new JComboBox();
                    jPanel1.add(countryComboBox);
                    countryComboBox.setModel(countryComboBoxModel);
                }
                {
                    ComboBoxModel passRetryComboBoxModel = new DefaultComboBoxModel(
                            new String[] { "byPass", "reTry", "status" });
                    passRetryComboBox = new JComboBox();
                    jPanel1.add(passRetryComboBox);
                    passRetryComboBox.setModel(passRetryComboBoxModel);
                }
                {
                    sendBtn = new JButton();
                    jPanel1.add(sendBtn);
                    sendBtn.setText("\u9001\u51fa");
                    sendBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            //TODO add your code for sendBtn.actionPerformed
                            new Thread(new Runnable() {
                                @Override
                                public void run() {
                                    readMessageId();
                                }
                            }).start();
                        }
                    });
                }
            }
            {
                jPanel2 = new JPanel();
                BorderLayout jPanel2Layout = new BorderLayout();
                jPanel2.setLayout(jPanel2Layout);
                jTabbedPane1.addTab("messageId", null, jPanel2, null);
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel2.add(jScrollPane1, BorderLayout.CENTER);
                    jScrollPane1.setPreferredSize(new java.awt.Dimension(604, 375));
                    {
                        messageIdArea = new JTextArea();
                        jScrollPane1.setViewportView(messageIdArea);
                    }
                }
            }
            {
                jPanel3 = new JPanel();
                BorderLayout jPanel3Layout = new BorderLayout();
                jPanel3.setLayout(jPanel3Layout);
                jTabbedPane1.addTab("?", null, jPanel3, null);
                {
                    jScrollPane2 = new JScrollPane();
                    jPanel3.add(jScrollPane2, BorderLayout.CENTER);
                    jScrollPane2.setPreferredSize(new java.awt.Dimension(604, 375));
                    {
                        executeLogArea = new JTextArea();
                        jScrollPane2.setViewportView(executeLogArea);
                    }
                }
            }
        }
        pack();
        this.setSize(617, 429);
    } catch (Exception e) {
        //add your error handling code here
        e.printStackTrace();
    }
}

From source file:gtu._work.ui.EstoreDAOCodeGenerateUI.java

private void initGUI() {
    try {/*from   w w  w .  j a  v a 2s  . c  o m*/
        BorderLayout thisLayout = new BorderLayout();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(thisLayout);
        {
            jTabbedPane1 = new JTabbedPane();
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            jTabbedPane1.setPreferredSize(new java.awt.Dimension(717, 582));
            {
                jPanel1 = new JPanel();
                GridLayout jPanel1Layout = new GridLayout(15, 1);
                jPanel1.setLayout(jPanel1Layout);
                jTabbedPane1.addTab("", null, jPanel1, null);
                {
                    jLabel1 = new JLabel();
                    jPanel1.add(jLabel1);
                    jLabel1.setText("entity\u540d\u7a31");
                }
                {
                    entityNameText = new JTextField();
                    jPanel1.add(entityNameText);
                }
                {
                    jLabel4 = new JLabel();
                    jPanel1.add(jLabel4);
                    jLabel4.setText("DAOImpl\u540d\u7a31");
                }
                {
                    daoImplText = new JTextField();
                    jPanel1.add(daoImplText);
                }
                {
                    jLabel5 = new JLabel();
                    jPanel1.add(jLabel5);
                    jLabel5.setText("DAOInterface\u540d\u7a31");
                }
                {
                    daoInterfaceText = new JTextField();
                    jPanel1.add(daoInterfaceText);
                }
                {
                    updateBtn = new JButton();
                    jPanel1.add(updateBtn);
                    updateBtn.setText("\u66f4\u65b0");
                    updateBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            updateBtnActionPerformed(evt);
                        }
                    });
                }
                {
                    makeFileBtn = new JButton();
                    jPanel1.add(makeFileBtn);
                    makeFileBtn.setText("\u7522\u751f\u6a94\u6848");
                    makeFileBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            try {
                                makeFileBtnActionPerformed(evt);
                            } catch (IOException e) {
                                JCommonUtil.handleException(e);
                            }
                        }
                    });
                }
            }
            {
                jPanel2 = new JPanel();
                BorderLayout jPanel2Layout = new BorderLayout();
                jPanel2.setLayout(jPanel2Layout);
                jTabbedPane1.addTab("xml", null, jPanel2, null);
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel2.add(jScrollPane1, BorderLayout.CENTER);
                    jScrollPane1.setPreferredSize(new java.awt.Dimension(712, 458));
                    {
                        jScrollPane2 = new JScrollPane();
                        jScrollPane1.setViewportView(jScrollPane2);
                        {
                            xmlConfigArea = new JTextArea();
                            jScrollPane2.setViewportView(xmlConfigArea);
                        }
                    }
                }
            }
        }
        pack();
        this.setSize(733, 525);
    } catch (Exception e) {
        e.printStackTrace();
    }
}