wait() and notify() trouble with UI
I have a program to copy images to another folder, and Im implementing a method to ask before overwriting an image of the same name. So in the loop of copying files, it checks if it already exists. If it does, then It displays a JDialog with the question. Since it checks in a loop, it has to use wait() to wait for the person to click the button. But whenever it hits the wait(), it does not update the images or the buttons on the JDialog until notified (which cant be done because you cant click on the button) even though im just using SetVisible(true) for the displaying of the dialog.
How can i fix this?
I know i might have to split it into two threads, but i dont know how i would do that with a jdialog.
So in a nutshell, I need a way to run my loop, check for a problem, pause the loop, display a dialog to fix the problem, continue loop.
ps: i have looked up quite a bit about wait() and synchronization, but i cant seem to find what im looking for.