Java examples for Swing:JButton
Setting an Accessible Name for an Image Button
import javax.swing.ImageIcon; import javax.swing.JButton; public class Main { public static void main(String[] args) { JButton button = new JButton(new ImageIcon("image.gif")); button.setToolTipText("Button Name"); button.getAccessibleContext().setAccessibleName("Button Name"); }/*from w w w. j a v a 2s . c o m*/ }