I have an app that sometimes kicks off a long-running process in a background thread. If it does this from the main app, I set the wait cursor like this:
oldCursor = App.getInstance().getGlassPane().getCursor();
App.getInstance().getGlassPane().setVisible(true);
App.getInstance().getGlassPane().setCursor(waitCursor);
This works, and I turn off the cursor like this:
App.getInstance().getGlassPane().setCursor(oldCursor);
App.getInstance().getGlassPane().setVisible(false);
So, now I sometimes do a long-running task from a JDialog
. (it has setModal(true)
)
Doing this in the JDialog
never changes the cursor:
oldCursor = getGlassPane().getCursor();
getGlassPane().setVisible(true);
getGlassPane().setCursor(waitCursor);
So, I tried setting it for the App, and that didn't work either.
Is there some way to get this working?