这里面包含了一百多个JAVA源文件

源代码在线查看: e611. setting focus traversal keys for the entire application.txt

软件大小: 551 K
上传用户: maple_78
关键词: JAVA
下载地址: 免注册下载 普通下载 VIP

相关代码

				This example changes the focus traversal keys for the entire application. For an example of how to change the focus traversal keys for a particular component, see e610 Setting Focus Traversal Keys in a Component. 
				    // Change the forward focus traversal keys for the application
				    Set set = new HashSet(
				        KeyboardFocusManager.getCurrentKeyboardFocusManager().getDefaultFocusTraversalKeys(
				            KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS));
				    set.clear();   // Call clear() if you want to eliminate the current key set
				    set.add(KeyStroke.getKeyStroke("F2"));
				    KeyboardFocusManager.getCurrentKeyboardFocusManager().setDefaultFocusTraversalKeys(
				        KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, set);
				    
				    // Change the backward focus traversal keys for the application
				    set = new HashSet(
				        KeyboardFocusManager.getCurrentKeyboardFocusManager().getDefaultFocusTraversalKeys(
				            KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS));
				    set.clear();   // Call clear() if you want to eliminate the current key set
				    set.add(KeyStroke.getKeyStroke("F3"));
				    KeyboardFocusManager.getCurrentKeyboardFocusManager().setDefaultFocusTraversalKeys(
				        KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, set);
				    
				    // Remove all forward and backward focus traversal keys for the application
				    set.clear();
				    KeyboardFocusManager.getCurrentKeyboardFocusManager().setDefaultFocusTraversalKeys(
				        KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, set);
				    KeyboardFocusManager.getCurrentKeyboardFocusManager().setDefaultFocusTraversalKeys(
				        KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, set);
				
							

相关资源