本文整理了Java中javax.swing.JComponent.getKeyListeners()
方法的一些代码示例,展示了JComponent.getKeyListeners()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComponent.getKeyListeners()
方法的具体详情如下:
包路径:javax.swing.JComponent
类名称:JComponent
方法名:getKeyListeners
暂无
代码示例来源:origin: lbalazscs/Pixelitor
private static void addFocusArrowListener(JComponent jc) {
/** Check to see if someone already added this kind of listener:
*/
KeyListener[] listeners = jc.getKeyListeners();
for(int a = 0; a<listeners.length; a++) {
if(listeners[a] instanceof FocusArrowListener)
return;
}
//Add our own:
jc.addKeyListener(new FocusArrowListener());
}
代码示例来源:origin: org.fudaa.framework.ebli/ebli-common
protected void setEnterAction(final JComponent _cp) {
final KeyListener l = getEnterAction();
// on ajoute le listener que s'il n'est pas pr�sent.
if (CtuluLibArray.findObject(_cp.getKeyListeners(), l) < 0) {
_cp.addKeyListener(getEnterAction());
}
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-gui-minigui
@Override
public void keyPressed(KeyEvent e) {
if((e.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0) {
if(e.getKeyCode() == KeyEvent.VK_SPACE //
|| e.getKeyCode() == KeyEvent.VK_ENTER //
|| e.getKeyCode() == KeyEvent.VK_DOWN //
|| e.getKeyCode() == KeyEvent.VK_KP_DOWN) {
final ParameterTable parent = ParameterTable.this;
if(!parent.isEditing()) {
int leadRow = parent.getSelectionModel().getLeadSelectionIndex();
int leadColumn = parent.getColumnModel().getSelectionModel().getLeadSelectionIndex();
parent.editCellAt(leadRow, leadColumn);
Component editorComponent = getEditorComponent();
// This is a hack, to make the content assist open immediately.
if(editorComponent instanceof DispatchingPanel) {
KeyListener[] l = ((DispatchingPanel) editorComponent).component.getKeyListeners();
for(KeyListener li : l) {
li.keyPressed(e);
}
}
}
}
}
}
代码示例来源:origin: elki-project/elki
@Override
public void keyPressed(KeyEvent e) {
if((e.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0) {
if(e.getKeyCode() == KeyEvent.VK_SPACE //
|| e.getKeyCode() == KeyEvent.VK_ENTER //
|| e.getKeyCode() == KeyEvent.VK_DOWN //
|| e.getKeyCode() == KeyEvent.VK_KP_DOWN) {
final ParameterTable parent = ParameterTable.this;
if(!parent.isEditing()) {
int leadRow = parent.getSelectionModel().getLeadSelectionIndex();
int leadColumn = parent.getColumnModel().getSelectionModel().getLeadSelectionIndex();
parent.editCellAt(leadRow, leadColumn);
Component editorComponent = getEditorComponent();
// This is a hack, to make the content assist open immediately.
if(editorComponent instanceof DispatchingPanel) {
KeyListener[] l = ((DispatchingPanel) editorComponent).component.getKeyListeners();
for(KeyListener li : l) {
li.keyPressed(e);
}
}
}
}
}
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki
@Override
public void keyPressed(KeyEvent e) {
if((e.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0) {
if(e.getKeyCode() == KeyEvent.VK_SPACE //
|| e.getKeyCode() == KeyEvent.VK_ENTER //
|| e.getKeyCode() == KeyEvent.VK_DOWN //
|| e.getKeyCode() == KeyEvent.VK_KP_DOWN) {
final ParameterTable parent = ParameterTable.this;
if(!parent.isEditing()) {
int leadRow = parent.getSelectionModel().getLeadSelectionIndex();
int leadColumn = parent.getColumnModel().getSelectionModel().getLeadSelectionIndex();
parent.editCellAt(leadRow, leadColumn);
Component editorComponent = getEditorComponent();
// This is a hack, to make the content assist open immediately.
if(editorComponent instanceof DispatchingPanel) {
KeyListener[] l = ((DispatchingPanel) editorComponent).component.getKeyListeners();
for(KeyListener li : l) {
li.keyPressed(e);
}
}
}
}
}
}
代码示例来源:origin: stackoverflow.com
clearInputMap(root.getInputMap(JComponent.WHEN_FOCUSED));
for (KeyListener keyListener : root.getKeyListeners()) {
root.removeKeyListener(keyListener);
代码示例来源:origin: stackoverflow.com
clearInputMap(root.getInputMap(JComponent.WHEN_FOCUSED));
for (KeyListener keyListener : root.getKeyListeners()) {
root.removeKeyListener(keyListener);
内容来源于网络,如有侵权,请联系作者删除!