X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix_swing%2Fgui%2Futils%2FListenerPanel.java;h=9e321fd972f163a5dd781943bdada94486380e1b;hb=af9d85e2a5024f9d408b5aa1cd236527e9562183;hp=0d356cf9679739370d69dd04f6d97ce0bc3cf2ac;hpb=9017ceb450da04d88af4ecc4a8946b3e5f07db0e;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix_swing/gui/utils/ListenerPanel.java b/src/be/nikiroo/fanfix_swing/gui/utils/ListenerPanel.java index 0d356cf..9e321fd 100644 --- a/src/be/nikiroo/fanfix_swing/gui/utils/ListenerPanel.java +++ b/src/be/nikiroo/fanfix_swing/gui/utils/ListenerPanel.java @@ -90,12 +90,11 @@ public class ListenerPanel extends JPanel { protected synchronized void fireActionPerformed(String listenerCommand) { ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, listenerCommand); - if (hasListeners()) { - Object[] listeners = listenerList.getListenerList(); - for (int i = listeners.length - 2; i >= 0; i -= 2) { - if (listeners[i] == ActionListener.class) { - ((ActionListener) listeners[i + 1]).actionPerformed(e); - } + + ActionListener[] listeners = getListeners(ActionListener.class); + if (listeners.length > 0) { + for (ActionListener action : listeners) { + action.actionPerformed(e); } } else { waitingQueue.add(e);