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