Here you can find the source of createButton(String name, ActionListener listener)
public static JButton createButton(String name, ActionListener listener)
//package com.java2s; //License from project: Open Source License import java.awt.event.ActionListener; import javax.swing.JButton; public class Main { public static JButton createButton(String name, ActionListener listener) { final JButton button = new JButton(name); button.addActionListener(listener); return button; }//from w ww .jav a2s.c om }