@Override public void setFields(Shopping shopping) { this.shopping = shopping; priceField.setText(Double.toString(shopping.getPrice())); quantityField.setText(Integer.toString(shopping.getQuantity())); }
@FXML private void handleOk() { if (isInputValid()) { shopping.setPrice(Double.parseDouble(priceField.getText())); shopping.setQuantity(Integer.parseInt(quantityField.getText())); shopping.setId(shopping.hashCode()); double totalPrice = shopping.getPrice() * shopping.getQuantity(); shopping.setTotalPrice(totalPrice); okClicked = true; dialogStage.close(); } }