Package java.awt.event

Examples of java.awt.event.ActionListener.actionPerformed()


    };

    closeButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        dialog.setVisible(false);
        saveChoice.actionPerformed(null);
      }
    });
    dialog.getRootPane().setDefaultButton(closeButton);

    dialog.addWindowListener(new WindowAdapter() {
View Full Code Here


    });
    dialog.getRootPane().setDefaultButton(closeButton);

    dialog.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
        saveChoice.actionPerformed(null);
      }
    });

    ((JComponent)dialog.getContentPane()).registerKeyboardAction(saveChoice,
      KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
View Full Code Here

        ActionEvent ae = new ActionEvent(this, 0, getText());
        for (int count=0;count<_listeners.size();count++)
        {
          ActionListener al = (ActionListener)_listeners.get(count);

          al.actionPerformed(ae);
        }
      }

      /**
       * Invoked when the mouse exits a component.
View Full Code Here

                  if (c != 0)
                  { // ignore null chars
                     ActionListener action = triggeredActions.get((char) c);
                     if (action != null)
                     {
                        action.actionPerformed(null);
                     }
                     else
                     {
                        putChar(c, true);
                     }
View Full Code Here

    protected void processActionEvent(ActionEvent e) {
        for (Iterator<?> i = actionListeners.getUserIterator(); i.hasNext();) {
            ActionListener listener = (ActionListener) i.next();
            switch (e.getID()) {
                case ActionEvent.ACTION_PERFORMED:
                    listener.actionPerformed(e);
                    break;
            }
        }
    }
View Full Code Here

    public void testCreateWithSetterCall() {
        Object invocationObject = new InvocationObject();
        ActionEvent ae = new ActionEvent(this, 0, "");
        ActionListener listener = EventHandler.create(ActionListener.class,
                invocationObject, "someObject", "source");
        listener.actionPerformed(ae);

        assertEquals(getObject(), invocationObject);
        assertEquals("setSomeObject", getMethodName());

        Object[] params = getParams();
View Full Code Here

    public void testCreateWithDottedParameterCall() {
        Object invocationObject = new InvocationObject();
        ActionEvent ae = new ActionEvent(this, 0, "");
        ActionListener listener = EventHandler.create(ActionListener.class,
                invocationObject, "someText", "source.text");
        listener.actionPerformed(ae);

        assertEquals(getObject(), invocationObject);
        assertEquals("setSomeText", getMethodName());

        Object[] params = getParams();
View Full Code Here

     */
    public void testCreateWithMethodCall() {
        Object invocationObject = new InvocationObject();
        ActionListener listener = EventHandler.create(ActionListener.class,
                invocationObject, "doSomething");
        listener.actionPerformed(new ActionEvent(this, 0, ""));

        assertEquals(getObject(), invocationObject);
        assertEquals("doSomething", getMethodName());

        Object[] params = getParams();
View Full Code Here

        synchronized(this) {
          l = (Vector)m_listeners.clone();
        }
        for (int i = 0; i < l.size(); i++) {
          ActionListener al = (ActionListener)l.elementAt(i);
          al.actionPerformed(e);
        }
      }
    }
   
    private double [] calculateRegionProbs(int j, int i) throws Exception {
View Full Code Here

                  if (c != 0)
                  { // ignore null chars
                     ActionListener action = triggeredActions.get((char) c);
                     if (action != null)
                     {
                        action.actionPerformed(null);
                     }
                     else
                     {
                        putChar(c, true);
                     }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.