If we have a class in Java responsilbe for building interfaces (builder), it builds an interface which the user interacts with (interface 1 )and the user clicks a button which does some processing using a calculation class.
Is there anyway of knowing when this processing is complete from the builder class so it can proceed to build the second interfce and hide/close the original?
I was thinking the interface could throw an event which can be listended for in the interface builder class.
Is there a more appropriate way of doing this?
A builder class should just build.
If you need something to listen for events and react by hiding or closing something and building something else, that sounds much more like a controller in Model-View-Controller or a related pattern. This controller would likely call the builder whenever it needs to close a view and present a new view, and it would be the recipient of such events.