📜  javafx 字符计数器 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:36.443000             🧑  作者: Mango

代码示例1
@Override
public void start(Stage primaryStage) {
    TextField textField = new TextField();
    Label label = new Label();
    label.textProperty().bind(textField.textProperty()
                                       .length()
                                       .asString("Character Count: %d"));
    VBox root = new VBox(label, textField);

    Scene scene = new Scene(root);

    primaryStage.setScene(scene);
    primaryStage.show();
}