Package java.awt.event

Examples of java.awt.event.WindowEvent


    public void handleEvent (Event e) {
      switch (e.type) {
        case SWT.Deiconify:
          EventQueue.invokeLater(new Runnable () {
            public void run () {
              frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_DEICONIFIED));
            }
          });
          break;
        case SWT.Iconify:
          EventQueue.invokeLater(new Runnable () {
            public void run () {
              frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_ICONIFIED));
            }
          });
          break;
      }
    }
View Full Code Here


    }

    public void setActive(boolean focus)
    {
        if (active == true && focus == false)
            dispatchEvent(new WindowEvent(GUIManager.getInstance(),
                    WindowEvent.WINDOW_DEACTIVATED));

        active = focus;
    }
View Full Code Here

    /**
     * Fire a WindowEvent with a given id to the awtComponent.
     */
    private final void fireWindowEvent(int id) {
        JNodeToolkit.postToTarget(new WindowEvent(targetComponent, id), targetComponent);
    }
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

                    } catch (InvocationTargetException e) {
                        handleSynthesizeException(e);
                    }
                } else {
                    if (activate) {
                        frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_ACTIVATED));
                        frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_GAINED_FOCUS));
                    } else {
                        frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_LOST_FOCUS));
                        frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_DEACTIVATED));
                    }
                }
            }
        });
    }
View Full Code Here

    public void handleEvent (Event e) {
      switch (e.type) {
        case SWT.Deiconify:
          EventQueue.invokeLater(new Runnable () {
            public void run () {
              frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_DEICONIFIED));
            }
          });
          break;
        case SWT.Iconify:
          EventQueue.invokeLater(new Runnable () {
            public void run () {
              frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_ICONIFIED));
            }
          });
          break;
      }
    }
View Full Code Here

              "Closing existing Evaluation Demo",
              JOptionPane.OK_CANCEL_OPTION,
              JOptionPane.WARNING_MESSAGE) != 0) {
        return false;
      }
      this.operatorGraphViewer.processWindowEvent(new WindowEvent(
          this.operatorGraphViewer, WindowEvent.WINDOW_CLOSING));
    }
//    if (Indices.operatorGraphViewer != null
//        && Indices.operatorGraphViewer.isVisible()) {
//      if (JOptionPane
View Full Code Here

                // isFocused method may not return the correct value
                // because the window is in transition.
                boolean hasFocus = (Boolean) component.getClientProperty(FRAME_ACTIVE_PROPERTY);
                if (hasFocus) {
                    focusListener.windowGainedFocus(
                            new WindowEvent(window, WindowEvent.WINDOW_GAINED_FOCUS));
                } else {
                    focusListener.windowLostFocus(
                            new WindowEvent(window, WindowEvent.WINDOW_LOST_FOCUS));
                }
            }
        };
    }
View Full Code Here

      close();
    }
  }

  private void close() {
    dispatchEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
  }
View Full Code Here

      close();
    }
  }

  private void close() {
    dispatchEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
  }
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.