java类库详细讲解

源代码在线查看: imagebutton.html

软件大小: 5593 K
上传用户: add505
关键词: java
下载地址: 免注册下载 普通下载 VIP

相关代码

				
				
				
				Setting an Accessible Name for an Image Button
				(Java Developers Almanac Example)
				
				
				
				
				
				
								    BODY CODE  {font-family: Courier, Monospace;				           font-size: 11pt}				    TABLE, BODY				          {font-family: Verdana, Arial, Helvetica, sans-serif;				           font-size: 10pt}				    PRE   {font-family: Courier, Monospace;				           font-size: 10pt}				    H3    {font-family: Verdana, Arial, Helvetica, sans-serif;				           font-size: 11pt}				    A.eglink {text-decoration: none}				    A:hover.eglink {text-decoration: underline}				    -->
				
				
				
				
				
				The Java Developers Almanac 1.4
				
				        Order this book from Amazon.
				    
				
				
				
				
				
				
				
				
				
				
				
				Home
				    >
				    List of Packages
				    >
				    javax.accessibility
				         [7 examples]
				        
				
				  
				    e692.  
				    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");
				
				
				
				
				             Related Examples
				        
				
				
				
				
				e691. 
				    The Quintessential Accessible Object
				
				
				
				e693. 
				    Setting a Description for Image Icons
				
				
				
				e694. 
				    Setting a Mnemonic for Buttons
				
				
				
				e695. 
				    Setting a Mnemonic for a Menu
				
				
				
				e696. 
				    Associating a Label with a Component
				
				
				
				e697. 
				    Setting a Keyboard Accelerator for a Menu Item
				
				
				
				
				
				
				
				
				© 2002 Addison-Wesley.
				
				
				
							

相关资源