本文整理匯總了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]", ""));
}
});
}