How do i add multiple combo boxes to JavaFX that once a item is selected the cost is display underneath?
<p>I would like to add multiple combo boxes to JavaFX that after the user has selected an item the cost of that item will be displayed under the combo box. Also that the total cost of all the selected items will be displayed at the bottom. I know how to make one combo box that will display the cost of one item selected but can't figure out how to make multiple ones and to display the cost of everything selected                                                    </p>

<pre><code>import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TextField;
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import javafx.util.StringConverter;
import javafx.collections.FXCollections;

public class Animals extends Application {

    Stage window;
    Scene scene;
    Button button;
    ComboBox&lt;Animal&gt; comboBox = new ComboBox&lt;Animal&gt;();
    Text textNamePrice = new Text();

    static public TextField[] tfLetters = new TextField[37];

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        window = primaryStage;
        window.setTitle("ComboBox ");
        button = new Button("Submit");

        comboBox = new ComboBox&lt;Animal&gt;();

        comboBox.setConverter(new StringConverter&lt;Animal&gt;() {
            @Override
            public String toString(Animal object) {
                return object.getName();
            }

            @Override
            public Animal fromString(String string) {
                return null;
            }
        });

        comboBox.setItems(FXCollections.observableArrayList(new Animal("Dog", 30.12), new Animal("Cat", 23.23),
                new Animal("Bird", 15.0)));

        comboBox.valueProperty().addListener((obs, oldVal, newVal) -&gt; {
            String selectionText = "Price of the " + newVal.getName() + " is : " + newVal.getPrice();

            System.out.println(selectionText);
            textNamePrice.setText(selectionText);
        });

        VBox layout = new VBox(10);
        layout.setPadding(new Insets(60, 60, 60, 60));
        layout.getChildren().addAll(comboBox, textNamePrice, button);

        scene = new Scene(layout, 500, 350);
        window.setScene(scene);
        window.show();
    }

    public class Animal {
        private String name;
        private Double price;

        public Double getPrice() {
            return price;
        }

        public String getName() {
            return name;
        }

        public Animal(String name, Double price) {
            this.name = name;
            this.price = price;
        }
    }
}
</code></pre>