This discussion is archived
3 Replies Latest reply: Nov 19, 2012 11:58 AM by 935199 RSS

How to temporarily consume or suspend input events to a Swing GUI

935199 Newbie
Currently Being Moderated
The question first started here, where it was all about suspending the actual EDT: Problem with interrupting the EDT "properly"

Now that this has proven to be potentially problematic, I'm looking for other ways to block input to a Swing GUI for a set amount of time. The reason I want to do this is to disable the user from manipulating any GUI controls for a second or so while a task that uses them completes, and if it takes longer, pop up a modal progress monitor. More details are given in the topic above.

One solution would to do mass disabling of all GUI components, but this provides a visual effect that can be problematic for several reasons as discussed in the topic above. Another suggestion was to use the glass pane to consume mouse input events, but accelerators, mnemonics and similar still seem to work, and maintaining dialogs can become problematic.

Any ideas on how to accomplish this? Thanks!

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points