Here you can find the source of createButton(JComponent parent, String description, MouseListener listener)
public static JButton createButton(JComponent parent, String description, MouseListener listener)
//package com.java2s; //License from project: Open Source License import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Main { /**//from www . ja v a 2 s. com * Creates a button with the given description text. */ public static JButton createButton(JComponent parent, String description, MouseListener listener) { JButton button = new JButton(description); button.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); button.addMouseListener(listener); parent.add(button); return button; } }