Results 1 to 2 of 2
Thread: Class explanation
- 02-05-2008, 04:22 PM #1
Member
- Join Date
- Jan 2008
- Posts
- 39
- Rep Power
- 0
Class explanation
Hey guys, i have a problem with this class. I can't understand exactly what is really doing. Can someone pls help me understand it? Thanks a lot.
This is the code:
Java Code:import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Calendar; import javax.swing.event.EventListenerList; public class ActionSupport { protected EventListenerList listenerList = new EventListenerList(); private Object bean; public ActionSupport(Object registeredBean) { this.bean = registeredBean; } public void fireActionPerformed(String actionCommand) { Object[] listeners = listenerList.getListenerList(); ActionEvent e = null; for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i] == ActionListener.class) { e = new ActionEvent(bean, ActionEvent.ACTION_PERFORMED, actionCommand, Calendar.getInstance().getTimeInMillis(), 0); ((ActionListener) listeners[i + 1]).actionPerformed(e); } } } public void addActionListener(ActionListener l) { listenerList.add(ActionListener.class, l); } public void removeActionListener(ActionListener l) { listenerList.remove(ActionListener.class, l); } }
- 02-05-2008, 06:50 PM #2
Similar Threads
-
what is the Priority for execution of Interface class and a Abstract class
By Santoshbk in forum Advanced JavaReplies: 0Last Post: 04-02-2008, 07:04 AM -
Inner class accessing outer class
By Java Tip in forum Java TipReplies: 0Last Post: 02-17-2008, 08:59 AM -
need a little explanation
By cew27 in forum New To JavaReplies: 7Last Post: 12-13-2007, 11:39 PM -
Explanation bout threading and concurrency?
By cruxblack in forum New To JavaReplies: 1Last Post: 08-10-2007, 10:33 AM -
I need didactic explanation
By Eric in forum New To JavaReplies: 2Last Post: 07-02-2007, 05:37 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks