首页 > 其他 > 详细

e610. Setting Focus Traversal Keys in a Component

时间:2018-09-06 10:25:51      阅读:138      评论:0      收藏:0      [点我收藏+]

When the focus is on a component, any focus traversal keys set for that component override the default focus traversal keys. For an example of how to change the focus traversal keys for the entire application, see e611 Setting Focus Traversal Keys for the Entire Application.

    // Change the forward focus traversal keys for a component
    Set set = new HashSet(component.getFocusTraversalKeys(
        KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS));
    set.clear();   // Call clear() if you want to eliminate the current key set
    set.add(KeyStroke.getKeyStroke("F2"));
    component.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, set);

 

Related Examples

e610. Setting Focus Traversal Keys in a Component

原文:https://www.cnblogs.com/borter/p/9596094.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!