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


Java KeyCode.ENTER属性代码示例

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


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

示例1: txtNomeSoftware_onKeyPressed

@FXML
void txtNomeSoftware_onKeyPressed(KeyEvent event) {
	if (event.getCode() == KeyCode.ENTER) {
		if (txtNomeSoftware.getText().equals("")) {
			preencherTableViewRequisitos(software.buscarTodosSoftwares());
		} else {
			preencherTableViewRequisitos(software.buscarPorNome(txtNomeSoftware.getText()));
		}
	}
}
 
开发者ID:dev-andremonteiro,项目名称:AlphaLab,代码行数:10,代码来源:FrmSolicitarReservaHorarioPorRequisito.java

示例2: processChange

/**
 * Handle changing alpha value.
 */
private void processChange(@Nullable final KeyEvent event) {
    if (isIgnoreListeners() || (event != null && event.getCode() != KeyCode.ENTER)) return;

    final TextField editableControl = getEditableControl();
    float newValue;
    try {
        newValue = Float.parseFloat(editableControl.getText());
    } catch (final NumberFormatException e) {
        return;
    }

    newValue = max(min(newValue, 1F), 0F);

    final AlphaInfluencerControl control = getControl();
    control.requestToChange(newValue, getIndex());
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:19,代码来源:AlphaInterpolationElement.java

示例3: updateValue

/**
 * Update the value.
 */
@FXThread
private void updateValue(@Nullable final KeyEvent event) {
    if (isIgnoreListener() || (event != null && event.getCode() != KeyCode.ENTER)) return;

    final String textValue = getValueField().getText();
    int[] newValue = null;

    if (!StringUtils.isEmpty(textValue)) {

        final String splitter = textValue.contains(" ") ? " " : ",";
        final String[] splited = textValue.split(splitter);

        newValue = new int[splited.length];

        for (int i = 0; i < splited.length; i++) {
            try {
                newValue[i] = Integer.parseInt(splited[i]);
            } catch (final NumberFormatException e) {
                LOGGER.warning(this, e);
                newValue = getPropertyValue();
                break;
            }
        }
    }

    changed(newValue, getPropertyValue());
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:30,代码来源:IntArrayPropertyControl.java

示例4: updateValue

/**
 * Update the value.
 */
@FXThread
private void updateValue(@Nullable final KeyEvent event) {
    if (isIgnoreListener() || (event != null && event.getCode() != KeyCode.ENTER)) return;

    final String textValue = getValueField().getText();
    float[] newValue = null;

    if (!StringUtils.isEmpty(textValue)) {

        final String splitter = textValue.contains(" ") ? " " : ",";
        final String[] splited = textValue.split(splitter);

        newValue = new float[splited.length];

        for (int i = 0; i < splited.length; i++) {
            try {
                newValue[i] = Float.parseFloat(splited[i]);
            } catch (final NumberFormatException e) {
                LOGGER.warning(this, e);
                newValue = getPropertyValue();
                break;
            }
        }
    }

    changed(newValue, getPropertyValue());
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:30,代码来源:FloatArrayPropertyControl.java

示例5: tblPedidos_onKeyPressed

@FXML
void tblPedidos_onKeyPressed(KeyEvent event) {
	if (event.getCode() == KeyCode.ENTER) {
		if (tblPedidos.getSelectionModel().getSelectedItem() != null) {
			preencherVisualizarDados(tblPedidos.getSelectionModel().getSelectedItem());
			tbpDados.getSelectionModel().select(tabDados);
		}
	}
}
 
开发者ID:dev-andremonteiro,项目名称:AlphaLab,代码行数:9,代码来源:FrmPedidosReserva.java

示例6: btnBuscar_onKeyPressed

@FXML
void btnBuscar_onKeyPressed(KeyEvent event) {
	if (event.getCode() == KeyCode.ENTER) {
		if (txtNomeSoftware.getText().equals("")) {
			preencherTableViewRequisitos(software.buscarTodosSoftwares());
		} else {
			preencherTableViewRequisitos(software.buscarPorNome(txtNomeSoftware.getText()));
		}
	}
}
 
开发者ID:dev-andremonteiro,项目名称:AlphaLab,代码行数:10,代码来源:FrmSolicitarReservaHorarioPorRequisito.java

示例7: handle

@Override
public void handle(KeyEvent event) {

    TextField editor = comboBox.getEditor();
    String text = editor.getText();

    if (event.getCode() == KeyCode.RIGHT
            || event.getCode() == KeyCode.LEFT
            || event.isControlDown()
            || event.getCode() == KeyCode.HOME
            || event.getCode() == KeyCode.END
            || event.getCode() == KeyCode.TAB) {
        return;
    }
    else if(event.getCode() == KeyCode.UP) {
        caretPos = -1;
        moveCaret(text.length());
        return;
    }
    else if(event.getCode() == KeyCode.DOWN) {
        if(!comboBox.isShowing()) {
            comboBox.show();
        }
        caretPos = -1;
        moveCaret(text.length());
        return;
    }
    else if(event.getCode() == KeyCode.BACK_SPACE) {
        moveCaretToPos = true;
        caretPos = editor.getCaretPosition();
    }
    else if(event.getCode() == KeyCode.DELETE) {
        moveCaretToPos = true;
        caretPos = editor.getCaretPosition();
    }

    String upperCaseText = text.toUpperCase();
    ObservableList<T> list = FXCollections.observableArrayList(data.stream()
            .filter(s -> transform.apply(s).toUpperCase().startsWith(upperCaseText))
            .collect(Collectors.toList()));

    comboBox.setItems(list);

    if (event.getCode() == KeyCode.ENTER
            || event.getCode() == KeyCode.ESCAPE) {
        if (!list.isEmpty()) {
            comboBox.getEditor().setText(transform.apply(list.get(0)));
            comboBox.getSelectionModel().select(0);
            comboBox.hide();
        }
        else {
            comboBox.getEditor().setText(text);
        }

    }
    else {
        comboBox.getEditor().setText(text);
        if(!moveCaretToPos) {
            caretPos = -1;
        }
        moveCaret(text.length());
        if(!list.isEmpty()) {
            comboBox.show();
        }
    }

}
 
开发者ID:mbari-media-management,项目名称:vars-annotation,代码行数:67,代码来源:AutoCompleteComboBoxListener.java

示例8: processKey

@Override
@FXThread
protected void processKey(@NotNull final KeyEvent event) {
    super.processKey(event);
    final Button okButton = getOkButton();
    if (okButton != null && event.getCode() == KeyCode.ENTER && !okButton.isDisable()) {
        processOk();
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:9,代码来源:AbstractSimpleEditorDialog.java

示例9: sendMethod

/**
 * 设置发送快捷键
 * @param event
 * @throws IOException
 */
@FXML public void sendMethod(KeyEvent event) {
       if (event.getCode() == KeyCode.ENTER) {
           sendBtnAction();
       }
   }
 
开发者ID:Laity000,项目名称:ChatRoom-JavaFX,代码行数:10,代码来源:ChatController.java

示例10: isEnter

protected boolean isEnter(KeyEvent event) {
    return event.getCode() == KeyCode.ENTER;
}
 
开发者ID:MrChebik,项目名称:Coconut-IDE,代码行数:3,代码来源:PresenterHelper.java

示例11: handleKeyInput

private void handleKeyInput(KeyCode code) {
	if(code == KeyCode.ENTER ){
		buttonLoginAction();
	}

}
 
开发者ID:LtubSalad,项目名称:voogasalad-ltub,代码行数:6,代码来源:PasswordManager.java

示例12: btnProximoRequisitos_onKeyPressed

@FXML
void btnProximoRequisitos_onKeyPressed(KeyEvent event) {
	if (event.getCode() == KeyCode.ENTER) {
		btnProximoRequisitos_onAction(new ActionEvent());
	}
}
 
开发者ID:dev-andremonteiro,项目名称:AlphaLab,代码行数:6,代码来源:FrmSolicitarReservaHorarioPorRequisito.java

示例13: txtNumMaxAlunos_onKeyPressed

@FXML
void txtNumMaxAlunos_onKeyPressed(KeyEvent event) {
	if (event.getCode() == KeyCode.ENTER)
		btnProximoRequisitos_onAction(new ActionEvent());
}
 
开发者ID:dev-andremonteiro,项目名称:AlphaLab,代码行数:5,代码来源:FrmSolicitarReservaHorarioPorRequisito.java

示例14: btnAlterar_onKeyPressed

@FXML
void btnAlterar_onKeyPressed(KeyEvent event) {
    if (event.getCode() == KeyCode.ENTER) {
        btnAlterar.fire();
    }
}
 
开发者ID:dev-andremonteiro,项目名称:AlphaLab,代码行数:6,代码来源:FrmCadastroDepartamento.java

示例15: btnConfirmar_onKeyPressed

@FXML
void btnConfirmar_onKeyPressed(KeyEvent event) {
    if (event.getCode() == KeyCode.ENTER) {
        btnConfirmar.fire();
    }
}
 
开发者ID:dev-andremonteiro,项目名称:AlphaLab,代码行数:6,代码来源:FrmCadastroDepartamento.java


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