funktionierender Wechsel zwischen den Views
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user