Setting an Accessible Name for an Image Button : Accessible « Swing JFC « Java






Setting an Accessible Name for an Image Button

 
import javax.swing.ImageIcon;
import javax.swing.JButton;

public class Main {
  public static void main(String[] argv) throws Exception {
  JButton button = new JButton(new ImageIcon("image.gif"));
    button.setToolTipText("Button Name");

    button.getAccessibleContext().setAccessibleName("Button Name");
  }
}

   
  








Related examples in the same category

1.implement Accessible to make your object accessible
2.Setting a Description for Image Icons
3.Setting a Mnemonic for Buttons for Accessible
4.Setting a Mnemonic for a Menu for Accessible
5.Associating a Label with a Component
6.Setting a Keyboard Accelerator for a Menu Item
7.A GUI to show accessible information coming from the components in an
8.An example of getting the Accessible information from a Button objectAn example of getting the Accessible information from a Button object
9.Has Displayed Name