486 * @see java.awt.event.ActionListener
487 * @since JDK1.1
488 */
489 public synchronized void removeActionListener(ActionListener l) {
490 if (l == null) {
491 return;
492 }
493 actionListener = AWTEventMulticaster.remove(actionListener, l);
494 }
495
496 /**
497 * Returns an array of all the action listeners
498 * registered on this textfield.
499 *
500 * @return all of this textfield's <code>ActionListener</code>s
501 * or an empty array if no action
502 * listeners are currently registered
503 *
504 * @see #addActionListener
505 * @see #removeActionListener
506 * @see java.awt.event#ActionListener
507 * @since 1.4
508 */
509 public synchronized ActionListener[] getActionListeners() {
510 return getListeners(ActionListener.class);
511 }
512
513 /**
514 * Returns an array of all the objects currently registered
515 * as <code><em>Foo</em>Listener</code>s
516 * upon this <code>TextField</code>.
517 * <code><em>Foo</em>Listener</code>s are registered using the
518 * <code>add<em>Foo</em>Listener</code> method.
519 *
520 * <p>
521 * You can specify the <code>listenerType</code> argument
522 * with a class literal, such as
523 * <code><em>Foo</em>Listener.class</code>.
524 * For example, you can query a
525 * <code>TextField</code> <code>t</code>
526 * for its action listeners with the following code:
|
486 * @see java.awt.event.ActionListener
487 * @since JDK1.1
488 */
489 public synchronized void removeActionListener(ActionListener l) {
490 if (l == null) {
491 return;
492 }
493 actionListener = AWTEventMulticaster.remove(actionListener, l);
494 }
495
496 /**
497 * Returns an array of all the action listeners
498 * registered on this textfield.
499 *
500 * @return all of this textfield's <code>ActionListener</code>s
501 * or an empty array if no action
502 * listeners are currently registered
503 *
504 * @see #addActionListener
505 * @see #removeActionListener
506 * @see java.awt.event.ActionListener
507 * @since 1.4
508 */
509 public synchronized ActionListener[] getActionListeners() {
510 return getListeners(ActionListener.class);
511 }
512
513 /**
514 * Returns an array of all the objects currently registered
515 * as <code><em>Foo</em>Listener</code>s
516 * upon this <code>TextField</code>.
517 * <code><em>Foo</em>Listener</code>s are registered using the
518 * <code>add<em>Foo</em>Listener</code> method.
519 *
520 * <p>
521 * You can specify the <code>listenerType</code> argument
522 * with a class literal, such as
523 * <code><em>Foo</em>Listener.class</code>.
524 * For example, you can query a
525 * <code>TextField</code> <code>t</code>
526 * for its action listeners with the following code:
|