Here you can find the source of addActionListenerToButtons(ActionListener l, AbstractButton... components)
Parameter | Description |
---|---|
l | the Listener to add |
components | The buttons to add the Listener to |
public static void addActionListenerToButtons(ActionListener l, AbstractButton... components)
//package com.java2s; //License from project: Apache License import javax.swing.AbstractButton; import java.awt.event.ActionListener; public class Main { /**//from ww w .j a v a 2s.c o m * This Method adds a Actionlistener to Several AbstractButtons * @param l the Listener to add * @param components The buttons to add the Listener to */ public static void addActionListenerToButtons(ActionListener l, AbstractButton... components) { for (AbstractButton component : components) { component.addActionListener(l); } } }