Here you can find the source of setButton(AbstractButton button, Icon icon, ActionListener buttonListener)
Set Button using given arguments.
Parameter | Description |
---|---|
button | the button to set |
icon | the icon to be set to button |
buttonListener | the ActionListener to be set to button |
static final void setButton(AbstractButton button, Icon icon, ActionListener buttonListener)
//package com.java2s; import java.awt.event.ActionListener; import javax.swing.AbstractButton; import javax.swing.Icon; public class Main { /**//from w w w. ja va2 s . co m * <p> * Set Button using given arguments. * </p> * * @param button * the button to set * @param icon * the icon to be set to button * @param buttonListener * the ActionListener to be set to button */ static final void setButton(AbstractButton button, Icon icon, ActionListener buttonListener) { // set icon or set invisible button.setIcon(icon); button.addActionListener(buttonListener); // set the content to not filled button.setContentAreaFilled(false); } }