Package java.awt.event

Examples of java.awt.event.WindowEvent


            @Override
            public void actionPerformed(final ActionEvent e) {
                // tell the frame to close itself
                JFrame topFrame = DataStorageApplication.this;
                WindowEvent windowClosing = new WindowEvent(topFrame, WindowEvent.WINDOW_CLOSING);
                topFrame.dispatchEvent(windowClosing);
            }
        });

        JMenuItem aboutMenuItem = new JMenuItem(new AbstractAction(MESSAGES.getString("Action.About")) {
View Full Code Here


    closeButton.setToolTipText("Closes this window.");
    closeButton.addActionListener(new ActionListener() {
      // Fires a window closing event
      @Override
      public void actionPerformed(ActionEvent e) {
        StatisticalOutputsWindow.this.dispatchEvent(new WindowEvent(StatisticalOutputsWindow.this, WindowEvent.WINDOW_CLOSING));
      }
    });
    JPanel ButtonsPanel = new JPanel();
    ButtonsPanel.add(closeButton , BorderLayout.WEST);
    ButtonsPanel.add(reDrawButton, BorderLayout.EAST);
View Full Code Here

        menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, ActionEvent.CTRL_MASK));
        menuItem.addActionListener(new AbstractAction() {
      private static final long serialVersionUID = 1L;
            public void actionPerformed(ActionEvent event) {
              JFrame frame = XBayaMenuItem.this.engine.getGUI().getFrame();
        frame.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING));
            }
        });
        return menuItem;
    }
View Full Code Here

    /**
     * Triggers the WINDOW_CLOSING event on this dialog.
     */
    protected void fireWindowClosing()
    {
        dispatchEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
    }
View Full Code Here

    close.setVisible(true);
    close.setToolTipText("Closes this window");
    close.addActionListener(new ActionListener() {
      // Fires a window closing event
      public void actionPerformed(ActionEvent e) {
        ResultsWindow.this.dispatchEvent(new WindowEvent(ResultsWindow.this, WindowEvent.WINDOW_CLOSING));
      }
    });

    toolbar.add(close);
    // Adds toolbar
View Full Code Here

  /**
   * Sends an exit signal to main window
   */
  public void exit() {
    // Send a closing signat to main window.
    mainWindow.dispatchEvent(new WindowEvent(mainWindow, WindowEvent.WINDOW_CLOSING));
  }
View Full Code Here

            this.jButtonIncluirItemExtra.setEnabled(false);
        }
    }//GEN-LAST:event_jButtonIncluirItemExtraActionPerformed

    private void jButtonSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSaveActionPerformed
        this.processWindowEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
        this.setVisible(false);
        this.dispose();
    }//GEN-LAST:event_jButtonSaveActionPerformed
View Full Code Here

        in = new ProgressMonitorInputStream(window, "Here we go...", realIn);
        in.read();
        Thread.sleep(600);
        in.skip(30);
        JDialog dialog = (JDialog) window.getOwnedWindows()[0];
        dialog.dispatchEvent(new WindowEvent(window, WindowEvent.WINDOW_CLOSING));
        in.reset();
        in.skip(30);
        testExceptionalCase(new ExceptionalCase() {
            @Override
            public void exceptionalAction() throws Exception {
View Full Code Here

        progressMonitor = new ProgressMonitor(window, "message test", "note test", 0, 100);
        progressMonitor.setProgress(1);
        Thread.sleep(500 + 100);
        progressMonitor.setProgress(20);
        dialog = (JDialog) window.getOwnedWindows()[1];
        dialog.dispatchEvent(new WindowEvent(window, WindowEvent.WINDOW_CLOSING));
        assertTrue(progressMonitor.isCanceled());
        progressMonitor.setProgress(98);
        assertEquals(2, window.getOwnedWindows().length);
    }
View Full Code Here

     * Class under test for void processWindowEvent(WindowEvent)
     */
    public void testProcessWindowEvent() {
        TestDialog dialog = new TestDialog();
        dialog.setVisible(true);
        WindowEvent e = new WindowEvent(dialog, WindowEvent.WINDOW_CLOSING);
        // test DO_NOTHING_ON_CLOSE
        dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
        dialog.disposeCalled = false;
        dialog.processWindowEvent(e);
        assertFalse("didn't call dispose()", dialog.disposeCalled);
View Full Code Here

TOP

Related Classes of java.awt.event.WindowEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.