Java JButton Create createButton(String name, ActionListener listener)

Here you can find the source of createButton(String name, ActionListener listener)

Description

create Button

License

Open Source License

Declaration

public static JButton createButton(String name, ActionListener listener) 

Method Source Code


//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
}

Related

  1. createButton(char mnemonic, Action action, Icon icon)
  2. CreateButton(final String name, final String text, final ImageIcon icon, final JPanel panel)
  3. createButton(Icon icon, String tooltip, String ac)
  4. createButton(ImageIcon icon, String text)
  5. createButton(String aText, String aTooltip, ActionListener aListener)
  6. createButton(String name, int x, int y, int width, int height, ImageIcon imageIcon)
  7. createButton(String text, boolean parse)
  8. createButton(String text, String icon)
  9. createButton16(final ImageIcon icon)