Example #1
0
 protected void fireFocusGained(boolean temporary) {
   FocusEvent foo = new FocusEvent(this, this.getID(), temporary);
   // Guaranteed to return a non-null array
   Object[] listeners = listenerList.getListenerList();
   // Process the listeners last to first, notifying
   // those that are interested in this event
   for (int i = listeners.length - 2; i >= 0; i -= 2) {
     if (listeners[i] == FocusListener.class) {
       ((FocusListener) listeners[i + 1]).focusGained(foo);
     }
   }
 }
Example #2
0
  protected void fireActionPerformed(String command) {
    ActionEvent foo = new ActionEvent(this, this.getID(), command);

    // Guaranteed to return a non-null array
    Object[] listeners = listenerList.getListenerList();

    // Process the listeners last to first, notifying
    // those that are interested in this event
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
      if (listeners[i] == ActionListener.class) {
        ((ActionListener) listeners[i + 1]).actionPerformed(foo);
      }
    }
  }
Example #3
0
 public void removeFocusListener(FocusListener listener) {
   if (listenerList != null) {
     listenerList.remove(FocusListener.class, listener);
   }
 }
Example #4
0
 public void addFocusListener(FocusListener listener) {
   if (listenerList != null) {
     listenerList.add(FocusListener.class, listener);
   }
 }
Example #5
0
 public void removeActionListener(ActionListener listener) {
   if (listenerList != null) {
     listenerList.remove(ActionListener.class, listener);
   }
 }
Example #6
0
 public void addActionListener(ActionListener listener) {
   if (listenerList != null) {
     listenerList.add(ActionListener.class, listener);
   }
 }