예제 #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);
     }
   }
 }
예제 #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);
      }
    }
  }
예제 #3
0
 public void removeFocusListener(FocusListener listener) {
   if (listenerList != null) {
     listenerList.remove(FocusListener.class, listener);
   }
 }
예제 #4
0
 public void addFocusListener(FocusListener listener) {
   if (listenerList != null) {
     listenerList.add(FocusListener.class, listener);
   }
 }
예제 #5
0
 public void removeActionListener(ActionListener listener) {
   if (listenerList != null) {
     listenerList.remove(ActionListener.class, listener);
   }
 }
예제 #6
0
 public void addActionListener(ActionListener listener) {
   if (listenerList != null) {
     listenerList.add(ActionListener.class, listener);
   }
 }