本文整理汇总了Java中javafx.scene.control.TextField.textProperty方法的典型用法代码示例。如果您正苦于以下问题:Java TextField.textProperty方法的具体用法?Java TextField.textProperty怎么用?Java TextField.textProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.TextField
的用法示例。
在下文中一共展示了TextField.textProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: maximumChunkSizeSelection
import javafx.scene.control.TextField; //导入方法依赖的package包/类
private Node maximumChunkSizeSelection( ProgrammerSettingDetails settingDetails )
{
HBox hBox = new HBox();
//TODO ensure numerical values only
Text maxChunkSizeLabel = new Text("Maximum chunk size: ");
maxChunkSizeLabel.setId(UIConstants.TEXT_COLOR);
TextField maxChunkSizeTextField = new TextField();
maxChunkSizeTextField.setText(settingDetails.getMaximumChunkSize());
maxChunkSizeTextField.textProperty().addListener(( observable, oldValue, newValue ) -> {
if ( !newValue.isEmpty() )
UIStyle.applyError(VerifyUtil.simpleIntegerCheck(newValue), maxChunkSizeTextField);
});
maximumChunkSizeSelectionModel = maxChunkSizeTextField.textProperty();
hBox.getChildren().addAll(maxChunkSizeLabel, maxChunkSizeTextField);
return hBox;
}
示例2: timeoutSelection
import javafx.scene.control.TextField; //导入方法依赖的package包/类
private Node timeoutSelection( ProgrammerSettingDetails settingDetails )
{
HBox hBox = new HBox();
Text receiveTimeoutLabel = new Text("Receive timout (ms): ");
receiveTimeoutLabel.setId(UIConstants.TEXT_COLOR);
TextField receiveTimeoutTextField = new TextField();
receiveTimeoutTextField.setText(settingDetails.getReceiveTimeoutMilliseconds());
receiveTimeoutTextField.textProperty().addListener(( observable, oldValue, newValue ) -> {
if ( !newValue.isEmpty() )
UIStyle.applyError(VerifyUtil.simpleIntegerCheck(newValue), receiveTimeoutTextField);
});
receiveTimeoutSelectionModel = receiveTimeoutTextField.textProperty();
hBox.getChildren().addAll(receiveTimeoutLabel, receiveTimeoutTextField);
return hBox;
}
示例3: forceNumericalInput
import javafx.scene.control.TextField; //导入方法依赖的package包/类
public static void forceNumericalInput(TextField numericalTextField) {
StringProperty pinTextProperty = numericalTextField.textProperty();
pinTextProperty.addListener((observableString, oldValue, newValue) -> {
if (!newValue.matches("\\d*")) {
numericalTextField.setText(newValue.replaceAll("[^\\d]", ""));
}
});
}