Blocking user input
Work sucks.I want make my application to be able to block user input while some operation is running. It appears not that easy. I came up with two sollutions. First, subclass glass pane in the top frame making it able to countercept all user input. A bad way IMHO. Not always you're allowed to do that and sometime glass pane is already corrupted by someone. Second, use modal dialog. I thought this to be a good idea but got a real problem with that. Operations run in a thread different from input blocker thread, since input blocker needs to be blocked when the dialog is shown. Blocking works fine, but sometimes unblock request comes too fast and the modal dialog is not visible yet. This leads to a zombie dialog hanging over the application and leaving user with no control over the program. There is no way to find out when the dialog is visible and the input blocker thread is in wait state since I used AWT Dialog class and its internals are private. Wanted to try ComponentListener but again need to synchronize three (operation + blocker + AWT) threads to do that. Seems crazy and bugful. Oh, and the blocker may still not be waiting at the moment component event arrives. I guess the best decision here would be to repeat what Dialog.show() does, though it may not work in the future. The source of this method looks like it has been written last minute before the deadline.
I wonder if I could put Java applets on these pages. Is it against the rules? There are so many free Java programs out there which could be useful but people just don't know how to use them. Someone publishes pictures, can't I publish applets?

<< Home