How listen event

I have to create one shop,

So I have one view that will be my MainView, with one cart summary, and I have 5 buttons, each one open a window with a diff crud, so when I close this window I need to add one item to my cart, So it`s possible to create one listener in my MainUI, and in every window fire one event that my MainView will listen??

something like this:

public class MainView implements View{
   listenAddEvent(MyAddEvent myAddEvent){
    // here I have my code

and in my windows I have something like this:

myButton.addClickLIstener( event -> {something.fireEvent(MyAddEvent.});


I would suggest looking at the
as it uses EventBus for what you are describing.

More specifically check the files under the
event package