I have a method inside one of my classes for my Java application that creates a Swing GUI and has its own action listeners - this works great. However, when the window is closed, I need a method to return the String[]
array; this is the part that causes the problems ...
I added a simple return
at the end of the method, but, obviously, Java did not wait for action listeners and thinks that this method will be completed after adding action listeners. So, is there a way to βhold onβ the method and then resume it when I'm ready, or even another solution to my problem?
Thanks at Advance
source share