Here you can find the source of makeButton(String name, ActionListener l)
Parameter | Description |
---|---|
name | a parameter |
l | a parameter |
public final static JButton makeButton(String name, ActionListener l)
//package com.java2s; //License from project: Open Source License import java.awt.event.ActionListener; import javax.swing.JButton; public class Main { /**// ww w . j a v a 2 s. c o m * Return a button with action command set to name. * * @param name * @param l * @return */ public final static JButton makeButton(String name, ActionListener l) { JButton button = new JButton(name); button.addActionListener(l); button.setActionCommand(name); return button; } }