当前位置: 首页>>代码示例>>Java>>正文


Java KeyEvent.VK_ENTER属性代码示例

本文整理汇总了Java中java.awt.event.KeyEvent.VK_ENTER属性的典型用法代码示例。如果您正苦于以下问题:Java KeyEvent.VK_ENTER属性的具体用法?Java KeyEvent.VK_ENTER怎么用?Java KeyEvent.VK_ENTER使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.awt.event.KeyEvent的用法示例。


在下文中一共展示了KeyEvent.VK_ENTER属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: keyPressed

public void keyPressed (KeyEvent e) {
    if ((e.getKeyCode () == KeyEvent.VK_ESCAPE && e.getModifiers () == 0) || 
        (e.getKeyCode () == KeyEvent.VK_ENTER  && e.getModifiers() == 0)
    ) {
        if (highlights == null) return;
        final List<Highlight> oldHighlights = highlights;
        SwingUtilities.invokeLater (new Runnable () {
            public void run () {
                Iterator<Highlight> it = oldHighlights.iterator ();
                while (it.hasNext ())
                    it.next ().remove ();
            }
        });
        editor.removeKeyListener (this);
        document.removeDocumentListener (this);
        highlights = null;
        elements = null;
        editor = null;
        document = null;
        renameImplementation = null;
         e.consume ();
    }    
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:InstantRenameAction.java

示例2: keyReleased

@Override
public void keyReleased(KeyEvent event) {
    super.keyPressed(event);
    if (!event.isConsumed() && event.getSource() == criteria.getSearchTextField() && event.getKeyChar() == KeyEvent.VK_ENTER) {
        event.consume();
        refreshData();
    }
}
 
开发者ID:CLARIN-PL,项目名称:WordnetLoom,代码行数:8,代码来源:SynsetViewUI.java

示例3: calibrationPanelKeyPressed

private void calibrationPanelKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_calibrationPanelKeyPressed
    switch (evt.getKeyCode()) {
        case KeyEvent.VK_SPACE:
            // send a message with pantilt and mouse filled in, tracker will fill in retina if there is a tracked locaton
            support.firePropertyChange(Message.AddSample.name(), null, new PanTiltCalibrationPoint(new Point2D.Float(), (Point2D.Float)lastPanTilt.clone(), (Point)lastMousePressLocation.clone()));
            repaint();
            return;
        case KeyEvent.VK_ENTER:
            support.firePropertyChange(Message.ComputeCalibration.name(), null, null);
            dispose();
            break;
        case KeyEvent.VK_BACK_SPACE:
            support.firePropertyChange(Message.EraseLastSample.name(), null, null);
            repaint();
            break;
        default:
            Toolkit.getDefaultToolkit().beep();
    }
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:19,代码来源:PanTiltGUI.java

示例4: jTextField_navMgrsKeyReleased

private void jTextField_navMgrsKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField_navMgrsKeyReleased
    switch (evt.getKeyCode()) {
        case KeyEvent.VK_ESCAPE: {
            Utilities.closeApplication(app);
            break;
        }
        case KeyEvent.VK_ENTER: {
            jButton_navGoToMgrsActionPerformed(null);
            break;
        }
        default: {
            //Clear the error message
            jLabel_mgrsMessage.setText(" ");
        }
    }
}
 
开发者ID:Esri,项目名称:defense-solutions-proofs-of-concept,代码行数:16,代码来源:MainMenuJPanel.java

示例5: keyPressed

public void keyPressed(KeyEvent e) {
    if (e.getKeyCode() == KeyEvent.VK_SPACE || e.getKeyCode() == KeyEvent.VK_ENTER ) {

        if ( e.getSource() instanceof JTree ) {
            JTree tree = (JTree) e.getSource();
            TreePath path = tree.getSelectionPath();

            if ( toggle( path )) {
                e.consume();
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:FmtSpaces.java

示例6: eDireccionKeyPressed

private void eDireccionKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_eDireccionKeyPressed
    // TODO add your handling code here:
    if(evt.getKeyCode() == KeyEvent.VK_ENTER)
    {
        eTelefono.requestFocus();
    }
}
 
开发者ID:JuanJoseFJ,项目名称:ProyectoPacientes,代码行数:7,代码来源:JDEditar.java

示例7: ccKeyPressed

private void ccKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_ccKeyPressed
    // TODO add your handling code here:
    if(evt.getKeyCode() == KeyEvent.VK_ENTER)
    {
        ee.requestFocus();
    }
}
 
开发者ID:JuanJoseFJ,项目名称:ProyectoPacientes,代码行数:7,代码来源:JDagEspecialidad.java

示例8: jTextVMOptionsKeyPressed

private void jTextVMOptionsKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextVMOptionsKeyPressed
    if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
        evt.consume();
    }
    if (evt.getKeyCode() == KeyEvent.VK_TAB) {
        if (evt.getModifiers() > 0) {
            jTextVMOptions.transferFocusBackward();
        } else {
            jTextVMOptions.transferFocus();
        }
        evt.consume();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:CustomizerRun.java

示例9: campoEmailKeyPressed

private void campoEmailKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_campoEmailKeyPressed
    if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
        entrarComEnter();
    } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) {
        dispose();
    }
}
 
开发者ID:lucas-dolsan,项目名称:tcc-rpg,代码行数:7,代码来源:TelaRegistrar.java

示例10: txtApellidoKeyPressed

private void txtApellidoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtApellidoKeyPressed
    // TODO add your handling code here:
            if(evt.getKeyCode() == KeyEvent.VK_ENTER)
    {
        btnBuscar.requestFocus();
    }

}
 
开发者ID:JuanJoseFJ,项目名称:ProyectoPacientes,代码行数:8,代码来源:JDBuscarPacientes.java

示例11: keyReleased

/**
 * {@inheritDoc}
 */
@Override
public void keyReleased(final KeyEvent e) {
    final Object source = e.getSource();

    if (m_gui.isClassField(source)) {
        if (e.getKeyCode() == KeyEvent.VK_ENTER) {
            actionUserAddedClass();
        }
    }
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:13,代码来源:ActiveLearnLoopEndNodeViewListener.java

示例12: keyPressed

@Override
public void keyPressed(KeyEvent e)
{
	int code = e.getKeyCode();
	if( code == KeyEvent.VK_ENTER || code == KeyEvent.VK_SPACE )
	{
		JComponent c = (JComponent) e.getComponent();
		c.setForeground(mTextPressed);
		c.setBackground(mBackgroundPressed);
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:11,代码来源:FlatterButtonUI.java

示例13: keyPressed

public void keyPressed(KeyEvent e) {
	if (e.getKeyCode() == KeyEvent.VK_ENTER) {
		updateValues();
		e.consume();
	}
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:6,代码来源:StationNamePanel.java

示例14: processKeyEvent

@Override
public void processKeyEvent(KeyEvent e) {
    shift = (e.getKeyCode() == KeyEvent.VK_ENTER && e.getID() == KeyEvent.KEY_PRESSED && e.isShiftDown());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:HtmlCompletionItem.java

示例15: keyReleased

@Override
public void keyReleased(KeyEvent ke) {
  if (myField.getText() == null) {
    myField.setText("");
    field = myField.getText();
  }

  if (ke.getKeyCode() == KeyEvent.VK_DOWN) {
    if (myList.size() == 1) {
      myField.setText( myList.get(0));
    }
    else if (list.getSelectedIndex() < list.getModel().getSize() - 1) {
      list.setSelectedIndex(list.getSelectedIndex());
      myField.setText( (String) list.getSelectedItem());
    }
    field = myField.getText();
    myField.requestFocus();
    return;
  }
  else if (ke.getKeyCode() == KeyEvent.VK_UP) {
    if (list.getSelectedIndex() > 0) {
      list.setSelectedIndex(list.getSelectedIndex());
    }
    myField.setText( (String) list.getSelectedItem());
    field = myField.getText();
    return;
  }
  else if (ke.getKeyCode() == KeyEvent.VK_ENTER) {
    field = myField.getText();
    action.actionPerformed(new ActionEvent(add,
                                           ActionEvent.ACTION_PERFORMED,
                                           "add"));
    return;
  }
  else if (ke.getKeyCode() == KeyEvent.VK_BACK_SPACE) {
  }
  else if (Character.isJavaIdentifierPart(ke.getKeyChar()) ||
           Character.isSpaceChar(ke.getKeyChar()) ||
           Character.isDefined(ke.getKeyChar())) {
  }
  else {
    return;
  }

  String startWith = myField.getText();
  myList = new Vector<String>();
  ArrayList<String> set = new ArrayList<String>(currentSelections.keySet());
  Collections.sort(set);
  set.add(0, "[New Chain]");
  boolean first = true;
  for (int i = 0; i < set.size(); i++) {
    String currString = set.get(i);
    if (currString.toLowerCase().startsWith(startWith.toLowerCase())) {
      if (first) {
        myField.setText(currString.substring(0, startWith.length()));
        first = false;
      }
      myList.add(currString);
    }
  }
  ComboBoxModel<String> model = new DefaultComboBoxModel<String>(myList);
  list.setModel(model);
  myField.setText(startWith);
  field = myField.getText();
  list.showPopup();
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:66,代码来源:CorefEditor.java


注:本文中的java.awt.event.KeyEvent.VK_ENTER属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。