super(msg); addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent me) { fireActionPerformed(new ActionEvent(SecretLabel.this, ActionEvent.ACTION_PERFORMED, "SecretMessage")); } });
// We'll just use the listenerList we inherit from JComponent. listenerList.add(ActionListener.class, l);
Object[] listeners = listenerList.getListeners(ActionListener.class); for (int i = 0; i < listeners.length; i++) { ((ActionListener)listeners[i]).actionPerformed(ae); }
listenerList.remove(ActionListener.class, l);