本文整理了Java中javax.swing.JTextField.getFocusTraversalKeys()
方法的一些代码示例,展示了JTextField.getFocusTraversalKeys()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextField.getFocusTraversalKeys()
方法的具体详情如下:
包路径:javax.swing.JTextField
类名称:JTextField
方法名:getFocusTraversalKeys
暂无
代码示例来源:origin: dcaoyuan/nbscala
public static JScrollPane createScrollableLineEditor(JEditorPane editorPane) {
editorPane.setKeymap(new FilteredKeymap(editorPane));
JScrollPane sp = new JScrollPane(editorPane, JScrollPane.VERTICAL_SCROLLBAR_NEVER,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
editorPane.setBorder (
new CompoundBorder (editorPane.getBorder (),
new EmptyBorder (0, 0, 0, 0))
);
JTextField referenceTextField = new JTextField();
int preferredHeight = referenceTextField.getPreferredSize().height;
if (sp.getPreferredSize().height < preferredHeight) {
sp.setPreferredSize(referenceTextField.getPreferredSize());
}
sp.setMinimumSize(sp.getPreferredSize());
Set<AWTKeyStroke> tfkeys = referenceTextField.getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
editorPane.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, tfkeys);
tfkeys = referenceTextField.getFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS);
editorPane.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, tfkeys);
return sp;
}
}
代码示例来源:origin: org.gephi/directory-chooser
Set<AWTKeyStroke> tKeys = filenameTextField.getFocusTraversalKeys(java.awt.KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
Set<AWTKeyStroke> newTKeys = new HashSet<>(tKeys);
newTKeys.remove(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, 0));
内容来源于网络,如有侵权,请联系作者删除!