Setting an Accessible Name for an Image Button

<script>function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}</script>

Setting an Accessible Name for an Image Button


You should also set the accessible name for components that only
show an image. The tool tip text, if set, serves as the accessible
name for a component. However, if the tool tip text is being used for
something else, set the component's accessible name.


JButton button = new JButton(new ImageIcon("image.gif"));
button.setToolTipText("Button Name");
// If tool tip is being used for something else,
// set the accessible name.
button.getAccessibleContext().setAccessibleName("Button Name");

为一个图像按钮设置一个存取名,你也应该为只显示图像的部件设置一个存取名。如果一个组件的提示符设置了的话,那么它可以作为这个组件的名字。然而,如果部件提示符被用于其他事情,就要设置它的存取名。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值