小编Ska*_*pka的帖子

JavaFX绑定带有int值的Label

我要绑定的JavaFX Label.textPropertyint价值.

我试过例如

Label.textProperty().bindBidirectional(new SimpleIntegerProperty(myInt), 
                                                      new NumberStringConverter());
Run Code Online (Sandbox Code Playgroud)

要么

Label().textProperty().bindBidirectional(new SimpleIntegerProperty(myInt), 
                                                              new DecimalFormat());
Run Code Online (Sandbox Code Playgroud)

但我总是得到NullPointerException.

我该如何解决?

java binding javafx

10
推荐指数
1
解决办法
1万
查看次数

标签 统计

binding ×1

java ×1

javafx ×1