Minor improvements in AccountviewController.java
This commit is contained in:
@@ -14,7 +14,6 @@ import javafx.stage.Stage;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -138,7 +137,6 @@ public class AccountviewController {
|
||||
|
||||
@FXML
|
||||
private void onShowAll() {
|
||||
System.out.println(this.privateBank.getTransactions(currentAccount));
|
||||
showTransactions(this.privateBank.getTransactions(currentAccount));
|
||||
}
|
||||
|
||||
@@ -148,10 +146,6 @@ public class AccountviewController {
|
||||
* @param transactions
|
||||
*/
|
||||
private void showTransactions(List<Transaction> transactions) {
|
||||
List<String> displayList = new ArrayList<>();
|
||||
for (Transaction t : transactions)
|
||||
displayList.add(t.toString());
|
||||
|
||||
transactionListView.getItems().setAll(transactions);
|
||||
updateAccountInfo(); // Balance neu anzeigen, falls sich was geändert hat
|
||||
}
|
||||
@@ -167,7 +161,7 @@ public class AccountviewController {
|
||||
|
||||
alert.getButtonTypes().setAll(yesButton, noButton);
|
||||
|
||||
var result = alert.showAndWait();
|
||||
Optional<ButtonType> result = alert.showAndWait();
|
||||
return result.isPresent() && result.get() == yesButton;
|
||||
}
|
||||
|
||||
@@ -177,10 +171,10 @@ public class AccountviewController {
|
||||
String desc = descriptionField.getText().trim();
|
||||
|
||||
// Basis-Checks
|
||||
if (desc.isEmpty()) return false;
|
||||
double amount;
|
||||
if (desc.isEmpty())
|
||||
return false;
|
||||
try {
|
||||
amount = Double.parseDouble(amountStr);
|
||||
double amount = Double.parseDouble(amountStr);
|
||||
} catch (NumberFormatException e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user