Here you can find the source of makeJButton(ResourceBundle resource, String panelName, String keyword, Icon icon, ActionListener listener)
public static JButton makeJButton(ResourceBundle resource, String panelName, String keyword, Icon icon, ActionListener listener)
//package com.java2s; // it under the terms of the GNU General Public License as published by import java.awt.event.ActionListener; import java.util.MissingResourceException; import java.util.ResourceBundle; import javax.swing.Icon; import javax.swing.JButton; public class Main { /**/* w ww . j a va 2 s . c o m*/ * Factory Method to create Button using specified params */ public static JButton makeJButton(ResourceBundle resource, String panelName, String keyword, Icon icon, ActionListener listener) { String label; try { label = resource.getString(panelName + "_BUTTON_" + keyword + "_LABEL"); } catch (MissingResourceException e) { label = "Missing Label"; } JButton button = new JButton(); if (label != null) button.setText(label); if (icon != null) button.setIcon(icon); button.addActionListener(listener); //setToolTip(resource, panelName, "BUTTON_"+keyword, button); return button; } }