Witam, oto fragment mojego kodu:

public class BuyProductController extends Controller {
...
 private void passBasket(Basket basket) throws IOException {
        FXMLLoader loader = new FXMLLoader();
        loader.setLocation(getClass().getClassLoader().getResource("MainCustomerPanel.fxml"));
        Parent root = loader.load();

        MainCustomerPanelController controller = loader.getController();
        controller.setBasket(basket);
        controller.updateBasketNumbers();

    }
...
}


public class MainCustomerPanelController extends Controller {
...
 public void updateBasketNumbers() {
 
        numberItemsText.setText("Przedmioty: " + basket.getTotal_items());
        totalValueText.setText("Wartość: " + basket.getTotalValue());
    }
...
}

Metoda updateBasketNumbers() odpowiada za wyświetlenia w oknie pól koszyka. numberItemsText oraz totalValueText są elementami widoku MainCustomerPanel.fxml.
BuyProductController jest kontrolerem działającym w nowym oknie. Pewien przycisk w tym kontrolerze wywołuje metodę passBasket(). Chciałbym aby natychmiast po przyciśnięciu tego przycisku automatycznie odświeżał się widok MainCustomerPanel.fxml. Obiekt "basket" przechodzi bez problemu do widoku MainCustomerPanel.fxml, aktualnie aby odświeżyć widok MainCustomerPanel.fxml muszę nacisnąć przycisk "Refresh" , który wywołuje wyżej opisaną metodę updateBasketNumbers() .
Czy ktoś mógłby mi powiedzieć co powinienem poprawić w kodzie?