funktionierender Wechsel zwischen den Views

This commit is contained in:
2024-12-07 15:09:25 +01:00
parent ed73c8e876
commit 9c4877edee
2 changed files with 4 additions and 4 deletions

View File

@@ -36,7 +36,7 @@ public class AccountviewController {
private void updateAccountInfo() {
accountNameLabel.setText("Account: " + currentAccount);
double balance = privateBank.getAccountBalance(currentAccount);
//balanceLabel.setText("Balance: " + balance);
balanceLabel.setText("Balance: " + balance);
}
private void loadTransactions() {
@@ -47,7 +47,7 @@ public class AccountviewController {
@FXML
private void onBackButtonClicked() {
try {
FXMLLoader loader = new FXMLLoader(getClass().getResource("/main.fxml"));
FXMLLoader loader = new FXMLLoader(getClass().getResource("/Mainview.fxml"));
Parent root = loader.load();
Stage stage = (Stage) transactionListView.getScene().getWindow();
@@ -92,7 +92,7 @@ public class AccountviewController {
for (var t : transactions) {
displayList.add(t.toString());
}
// transactionListView.getItems().setAll(displayList);
transactionListView.getItems().setAll(displayList);
updateAccountInfo(); // Balance neu anzeigen, falls sich was geändert hat
}
}

View File

@@ -95,7 +95,7 @@ public class MainviewController {
private void switchToAccountView(String accountName) {
try {
// Laden der zweiten FXML
FXMLLoader loader = new FXMLLoader(getClass().getResource("Accountview.fxml"));
FXMLLoader loader = new FXMLLoader(getClass().getResource("/Accountview.fxml"));
Parent root = loader.load();
// Zugriff auf Controller und Datenübergabe