private void addActionListeners(Component comp, ActionListener listener) {
		if (isButton(comp)) {
			if (!hasActionListener(comp)) {
				try {
					Class[] types = { Class.forName("java.awt.event.ActionListener") };
					Object[] args = { listener };
					Method addActionListener = comp.getClass().getMethod("addActionListener", types);
					addActionListener.invoke(comp, args);
				} catch (Exception ex) {
					throw new ErrorException(ex);
				}
			}
		} else if (comp instanceof Container) {
			Container container = (Container) comp;
			int nComponents = container.getComponentCount();
			for (int i = 0; i < nComponents; i++) {
				addActionListeners(container.getComponent(i), listener);
			}
		}
	}