List of usage examples for javafx.collections ObservableMap addListener
public void addListener(MapChangeListener<? super K, ? super V> listener);
From source file:Main.java
public static void main(String[] args) { Map<String, String> map = new HashMap<String, String>(); ObservableMap<String, String> observableMap = FXCollections.observableMap(map); observableMap.addListener(new MapChangeListener() { @Override// w ww . ja v a2 s. c o m public void onChanged(MapChangeListener.Change change) { System.out.println("change! "); } }); observableMap.put("key 1", "value 1"); map.put("key 2", "value 2"); }