所以现在我正在阅读有关RxJavaFX的内容,偶然发现了以下示例:
var comboBox = new ComboBox <String> ();
comboBox.getItems().setAll("Alpha", "Beta", "Gamma", "Delta", "Epsilon");
JavaFxObservable.valuesOf(comboBox.valueProperty())
.subscribe(v - > System.out.println(v + " was selected "));
为什么我要使用上面的示例代替它?
var comboBox = new ComboBox <String> ();
comboBox.getItems().setAll("Alpha", "Beta", "Gamma", "Delta", "Epsilon");
comboBox.setOnAction(ae -> System.out.println(comboBox.getValue()));
我在这里看不到使用RxJavaFX的好处。我想念什么?