JavaFx, How to insert ObservableMap into TableView?

I want to populate map values into tableview. I tried with observableList and its working fine. Whenever any value adds to list then table values are updates / refresh and shows new changes.

I want to do the same with map also. Whenever I adds any value to map table view needs to be refresh but it is not. I read so many articles but not able to solve this issue.

Article :

  1. Populate TableView with ObservableMap JavaFX
  2. How to display an ObservableMap via JavaFX’s TableView

My Java code.

public class MapExample {

    private static int i = 0;

    private TableView<Map.Entry<String, Person>> tableview;

    private ObservableMap<String, Person> map = FXCollections.observableHashMap();

    public void initialize() {

        System.out.println("Map Example !!");

        map.put("Vijay", new Person("Rahul", "Kakade"));

        map.addListener((MapChangeListener<String, Person>) change -> {
            if (change.wasAdded()) {
                System.out.println("If part !!");
                map.forEach((k, v) -> System.out
                        .println("Key :" + k + " Name :" + v.getFirstName() + " Last :" + v.getLastName()));
            } else if (change.wasRemoved()) {
                System.out.println("Else part !!");
                map.forEach((k, v) -> System.out
                        .println("Key :" + k + " Name :" + v.getFirstName() + " Last :" + v.getLastName()));

        TableColumn<Map.Entry<String, Person>, String> col = new TableColumn<>("Name");
                (TableColumn.CellDataFeatures<Map.Entry<String, Person>, String> p) -> new SimpleStringProperty(

        TableColumn<Map.Entry<String, Person>, String> col2 = new TableColumn<>("FirstName");
                (TableColumn.CellDataFeatures<Map.Entry<String, Person>, String> p) -> new SimpleStringProperty(

        TableColumn<Map.Entry<String, Person>, String> col3 = new TableColumn<>("LastName");
                (TableColumn.CellDataFeatures<Map.Entry<String, Person>, String> p) -> new SimpleStringProperty(



        ExecutorService service = Executors.newSingleThreadExecutor();

        service.execute(() -> {

            while (true) {
                try {
                } catch (InterruptedException e) {
                    // TODO Auto-generated catch block

                map.put("Vijay", new Person("Rahul" + i++, "Kakade" + i));




Person Model :

public class Person {
    private String firstName = null;
    private String lastName = null;
    //getter and setter

I know there is some small mistake but not able to solve it. Please tell me where I am wrong.

Thanks in advance.

Return observables timing issues

I have a very common issue in my app and I can’t find a proper solution. I have methods that MAY need to open a confirmation modal where the user can choose yes or no.
checkData1 = (): Observable<any> => {
this.subject = new…

Angular filter objects list

I meet a problem for filtering a list with multiple filters, let me explain:
My component takes in input a list of object. I display this list in the template and i’d like to filter this list with a search input and two others filter check…