Package java.awt.event

Examples of java.awt.event.AWTEventListener


  try {
    /* Call registerListeners() to make XEmbed focus traversal work */
    Method method = clazz.getMethod("registerListeners", null);
    if (method != null) method.invoke(value, null);
  } catch (Throwable e) {}
  final AWTEventListener awtListener = new AWTEventListener() {
    public void eventDispatched(AWTEvent event) {
      if (event.getID() == WindowEvent.WINDOW_OPENED) {
        final Window window = (Window) event.getSource();
        if (window.getParent() == frame) {
          parent.getDisplay().asyncExec(new Runnable() {
View Full Code Here


   * Dispatches the given event to the wrapped event listener. If the wrapped listener is <code>null</code>
   * (garbage-collected,) this listener will remove itself from the default toolkit.
   * @param e the event dispatched in the AWT.
   */
  public void eventDispatched(AWTEvent e) {
    AWTEventListener listener = listenerReference.get();
    if (listener == null) {
      dispose();
      return;
    }
    listener.eventDispatched(e);
  }
View Full Code Here

    JPanel statusBar = (JPanel) swingEngine.render(getClass().getResource("/swixml/StatusBar.xml"));

    jframe.getContentPane().add(statusBar, BorderLayout.SOUTH);

    jframe.getToolkit().addAWTEventListener(new AWTEventListener()
    {
      public void eventDispatched(AWTEvent e)
      {
        if (e.getSource() instanceof JComponent)
        {
View Full Code Here

           
        });
        findField.setAction(getAction(FindAction.getActionName()));
        JLabel findLabel = new JLabel("Search:");
        findLabel.setLabelFor(findField);
        Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
            public void eventDispatched(AWTEvent event) {
              
               
                if (event instanceof KeyEvent) {
                  
View Full Code Here

        activity();
        return false;
      }
    });

    AWTEventListener listener = new AWTEventListener() {
      public void eventDispatched(AWTEvent event) {
        activity();
      }
    };
View Full Code Here

          the.close();
          System.exit(0);
        }
      });
      Toolkit.getDefaultToolkit().addAWTEventListener(
          new AWTEventListener() {
            public void eventDispatched(AWTEvent event) {
              KeyEvent e = (KeyEvent) event;
              if (e.getID() == KeyEvent.KEY_PRESSED) {
                the.sendKey(KeyEvent.KEY_PRESSED, e
                    .getKeyCode(), e.getKeyChar(), e
View Full Code Here

    });
  }
  public static void fmain(String[] args) {
    JFrame frame = new JFrame() {
      {
        getToolkit().addAWTEventListener(new AWTEventListener() {
          public void eventDispatched(AWTEvent e) {

            KeyEvent keyEvent = (KeyEvent) e;
            if (keyEvent.getID() == KeyEvent.KEY_RELEASED) {
              if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) {
View Full Code Here

    }

    static final List<JInternalFrame> frames = new ArrayList<JInternalFrame>();

    public static void init() {
        Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
            public void eventDispatched(AWTEvent event) {
                if (event.getSource() instanceof JInternalFrame) {
                    if (event.getID() == ComponentEvent.COMPONENT_SHOWN)
                        frames.add((JInternalFrame) event.getSource());
                    if (event.getID() == ComponentEvent.COMPONENT_HIDDEN)
View Full Code Here

  // general factory
  private static MouseReact<Integer> createListener(final Predicate1<MouseEvent> filter, final Function1<MouseEvent, Integer> map, long eventMask) {
    final MouseReact<Integer> react = new MouseReact<Integer>();

    AWTEventListener listener = new AWTEventListener() {

      @Override
      public void eventDispatched(AWTEvent e) {
        if (e instanceof MouseEvent) {
          MouseEvent ev = (MouseEvent) e;
View Full Code Here

  // factories
  private static MouseReact<Boolean> createButtonListener(final int buttonNumber) {
    final MouseReact<Boolean> react = new MouseReact<Boolean>();

    AWTEventListener listener = new AWTEventListener() {

      @Override
      public void eventDispatched(AWTEvent e) {
        if (e instanceof MouseEvent) {
          MouseEvent ev = (MouseEvent) e;
View Full Code Here

TOP

Related Classes of java.awt.event.AWTEventListener

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.