funktionierender Wechsel zwischen den Views
This commit is contained in:
@@ -36,7 +36,7 @@ public class AccountviewController {
|
|||||||
private void updateAccountInfo() {
|
private void updateAccountInfo() {
|
||||||
accountNameLabel.setText("Account: " + currentAccount);
|
accountNameLabel.setText("Account: " + currentAccount);
|
||||||
double balance = privateBank.getAccountBalance(currentAccount);
|
double balance = privateBank.getAccountBalance(currentAccount);
|
||||||
//balanceLabel.setText("Balance: " + balance);
|
balanceLabel.setText("Balance: " + balance);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadTransactions() {
|
private void loadTransactions() {
|
||||||
@@ -47,7 +47,7 @@ public class AccountviewController {
|
|||||||
@FXML
|
@FXML
|
||||||
private void onBackButtonClicked() {
|
private void onBackButtonClicked() {
|
||||||
try {
|
try {
|
||||||
FXMLLoader loader = new FXMLLoader(getClass().getResource("/main.fxml"));
|
FXMLLoader loader = new FXMLLoader(getClass().getResource("/Mainview.fxml"));
|
||||||
Parent root = loader.load();
|
Parent root = loader.load();
|
||||||
|
|
||||||
Stage stage = (Stage) transactionListView.getScene().getWindow();
|
Stage stage = (Stage) transactionListView.getScene().getWindow();
|
||||||
@@ -92,7 +92,7 @@ public class AccountviewController {
|
|||||||
for (var t : transactions) {
|
for (var t : transactions) {
|
||||||
displayList.add(t.toString());
|
displayList.add(t.toString());
|
||||||
}
|
}
|
||||||
// transactionListView.getItems().setAll(displayList);
|
transactionListView.getItems().setAll(displayList);
|
||||||
updateAccountInfo(); // Balance neu anzeigen, falls sich was geändert hat
|
updateAccountInfo(); // Balance neu anzeigen, falls sich was geändert hat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public class MainviewController {
|
|||||||
private void switchToAccountView(String accountName) {
|
private void switchToAccountView(String accountName) {
|
||||||
try {
|
try {
|
||||||
// Laden der zweiten FXML
|
// Laden der zweiten FXML
|
||||||
FXMLLoader loader = new FXMLLoader(getClass().getResource("Accountview.fxml"));
|
FXMLLoader loader = new FXMLLoader(getClass().getResource("/Accountview.fxml"));
|
||||||
Parent root = loader.load();
|
Parent root = loader.load();
|
||||||
|
|
||||||
// Zugriff auf Controller und Datenübergabe
|
// Zugriff auf Controller und Datenübergabe
|
||||||
|
|||||||
Reference in New Issue
Block a user