Here you can find the source of createNoURLGraphicalButton(String imageName, String alternateText)
Parameter | Description |
---|---|
imageName | the mage to place in the button |
alternateText | the alternate text to use if image unavailable |
static public JButton createNoURLGraphicalButton(String imageName, String alternateText)
//package com.java2s; //License from project: Open Source License import javax.swing.ImageIcon; import javax.swing.JButton; public class Main { /**//from w w w.j av a2s .c o m * Creates a JButton using <i>imageName</i>, or if <i>imageName</i> is unavailable, use * <i>alternateText</i> * * @param imageName * the mage to place in the button * @param alternateText * the alternate text to use if image unavailable * @return a graphical JButton * @see JButton */ static public JButton createNoURLGraphicalButton(String imageName, String alternateText) { return new JButton(alternateText, new ImageIcon(imageName)); } }