SHARE
TWEET

Untitled

a guest Jun 24th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. addButton.setOnAction(new EventHandler<ActionEvent>() {
  2.  
  3.         @Override
  4.         public void handle(ActionEvent event) {
  5.             Operation operation = new Operation();
  6.             operation.addRecord(dateTextField, distanceTextField, lpgAmountTextField, lpgPriceTextField,
  7.                     petrolAmountTextField, petrolPriceTextField, paidLabel, savingLabel, gasEfficiencyLabel,
  8.                     contentTable, totalSavingsLabel);
  9.  
  10.             operation.totalPaidSaving(contentTable, totalSavingsLabel);
  11.         }
  12.  
  13.     });
  14.      
  15. @SuppressWarnings("unchecked")
  16. public void configurateTable() {
  17.  
  18.     TableColumn<GasRecords, String> savingColumn = new TableColumn<GasRecords, String>(SAVING_COLUMN);
  19.     savingColumn.setCellValueFactory(new PropertyValueFactory<>("saving"));
  20.  
  21.  
  22.     contentTable.getColumns().addAll(dateColumn, distanceColumn, lpgAmountColumn, lpgPriceColumn, petAmountColumn,
  23.             petPriceColumn, paidColumn, savingColumn, gasEfficiencyColumn);
  24.  
  25. }
  26.      
  27. public void totalPaidSaving(TableView<GasRecords> cT, Label tSL) {
  28.  
  29.     String totalSavingValue = "0";
  30.  
  31.     //the code that calculates the sum of the values ​​of a particular column
  32.  
  33.     tSL.setText(String.format("%.2f zł", totalSavingValue));
  34.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top