Map_BindContent1
 
Code:

package javafxtemplate1;
//
//textProperty().addListener Listview Label
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.stage.Stage;
import javafx.beans.binding.ObjectBinding;
import javafx.beans.property.MapProperty;
import javafx.beans.property.SimpleMapProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.collections.FXCollections;

/**
*
* @author Manas9
*/
public class JavaFXTemplate1 extends Application {

@Override
public void start(Stage primaryStage) throws Exception {
//

Group groot1 = new Group();
Label label1 = new Label("l1"); Label label2 = new Label("l2");
Label label3 = new Label("l3"); Label label4 = new Label("-----");
Label label5 = new Label("------");Label label6 = new Label("l6");
label1.setLayoutX(10);label1.setLayoutY(20);
label2.setLayoutX(10);label2.setLayoutY(40);
label3.setLayoutX(10);label3.setLayoutY(60);
label4.setLayoutX(10);label4.setLayoutY(80);
label5.setLayoutX(10);label5.setLayoutY(100);
label6.setLayoutX(10);label6.setLayoutY(120);
//label1.setText(visitor.firstNameProperty().get());
//label2.setText(visitor.ageProperty().toString());
MapProperty<String, Double> mappro1 =
new SimpleMapProperty<>(FXCollections.observableHashMap());
MapProperty<String, Double> mapprop2 =
new SimpleMapProperty<>(FXCollections.observableHashMap());

// Create an object binding to bind map value to the key "A1"
ObjectBinding<Double> A1Value = mappro1.valueAt("A1");
label1.setText("A1 Value: " + A1Value.get());

//string property to map key and values
StringProperty initStr = new SimpleStringProperty("Size: " );
StringProperty desc = new SimpleStringProperty();
desc.bind(initStr.concat(mappro1.sizeProperty())
.concat(", Empty: ")
.concat(mappro1.emptyProperty())
.concat(", MapKey/Value " )
.concat(mappro1.asString()));
label2.setText("Empty Key:Value mappro1.put(): " + desc.get());
// Add entries as Key ::Value
mappro1.put("A1", 12.25);
mappro1.put("A2", 24.25);
mappro1.put("A3",36.25);
label4.setText("-------");
label3.setText("--After mappro1.put(): " + desc.get());
// Populate mappro2
mapprop2.put("B1", 48.25);
mapprop2.put("B2", 60.25);
label5.setText("mapprop2.put: " + desc.get());
mappro1.bindContent(mapprop2);
label6.setText(" mappro1.bindContent(mapprop2); " + desc.get());

groot1.getChildren().addAll(label1,label4,label2,label3, label5,label6);
//
Scene scene = new Scene(groot1, 600, 150);
primaryStage.setScene(scene);
primaryStage.setTitle("Object:: Boolean Binding");
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}

}