Skip to content

Question - Change Listener in RxJava #7087

@bytecod3r

Description

@bytecod3r

I am very new to RxJava,

I just want to ask if RxJava has any alternative feature to JavafX Observable Change Listener. So I want to implement something like below with RxJava. I hope I am not wrong about Observable in RxJava and its similar to JavaFx..

ObservableList ov = new ....
ov .addListener(new ChangeListener<String>() {
        @Override
        public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
            if (!newValue.matches("\\d*")) {
                textField.setText(newValue.replaceAll("[^\\d]", ""));
            }

            if (newValue.isEmpty())
                textField.setText("0");

        }
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions