是否有 Swing 元素将 F6 作为默认加速器?
我有一个带有选项卡式窗格和其中不同组件的应用程序。我已将 MenuItem 设置为带有加速器的操作:
private final Action focusDefaultCommandsAction = new AbstractAction()
{
{
putValue(NAME, "Fokusiere Kommandoliste");
putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F6, 0));
}
@Override
public void actionPerformed(final ActionEvent e)
{
invokeShowCommandsList();
}
};
我知道有一个选项卡,F6 键的加速器不起作用。 F7 键有效。
Swing Element 上是否有一个默认加速器的优先级高于我的加速器?
I have an application with a tabbed pane and different components in it. I have set a MenuItem as Action with an Accelerator:
private final Action focusDefaultCommandsAction = new AbstractAction()
{
{
putValue(NAME, "Fokusiere Kommandoliste");
putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F6, 0));
}
@Override
public void actionPerformed(final ActionEvent e)
{
invokeShowCommandsList();
}
};
I know there is one tab where the Accelearator for the F6 key doesn't work. the F7 key works.
Is there maybe a default accelerator on a Swing Element that has priority over my accelerator?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在 BasicLookAndFeel.java(或类似的类,具体取决于您使用的 L&F)中查找它,按 F6 搜索。
看起来 JSplitPane 使用 F6 在内容和分隔线之间切换焦点。
要删除它,您可以使用类似的东西(未经测试,我认为删除实际操作更困难,因为它可能位于父输入映射中):
You can look this up in BasicLookAndFeel.java (or similar class depending on the L&F you use), search on F6.
Looks like F6 is used by JSplitPane to toggle focus between the content and the dividers.
To remove it you could use something like (not tested, I think removing the actual action is harder because it might be in a parent input map):