Setting a Description for Image Icons
Image icons can be inserted in a variety of places such as in a textor tree component. You should set a description for image icons tohelp blind users.ImageIcon icon = new ImageIcon("image.gif");icon.setDescription("Description of Image");
ImageIcon的setDescription方法的用法如下:
setDescriptionpublic void setDescription(String description)设置图像的描述。此描述应该是该对象的简明文本描述。例如,可以将它呈现给盲人用户,为他们提供该图像用途的指示。 参数:description - 图像的简明文本描述。
首先创建一个ImageIcon的对象,参数为图像文件名,然后setDescription,参数为描述的文本。
相关资源:敏捷开发V1.0.pptx