help fix a problem with modal windows

Discussion in 'Java' started by Jean Lutrin, Sep 17, 2004.

  1. Jean Lutrin

    Jean Lutrin Guest

    Hi all,

    I'm doing some maintenance/refactoring on a "medium sized" Swing
    applications. This application is deployed on several machines,
    in an uncontrolled environment. There are quite a lot of annoying
    problems with modal windows/frames, amongst other:
    - for whatever reason, a modal window appears under the main frame
    and the stays blocked until the user someone notice that there's
    a window "underneath" is current window
    - on some systems using "desktop pager", the modal window sometimes
    appears on the wrong "desktop" and the user never gets to see it
    (this arrives, for example, it the user switches quickly from one
    desktop to another... so it's not a bug of the Swing app, but a "bug"
    (call it a feature if you like ;) of the "desktop pager").

    The users complaints are, in those two cases, the same : there's a
    window open, but they don't see it... So they think the app is blocked
    until they, somehow, find where that modal window is.

    I don't see it as a bug of the Swing app and it definetely can
    happen in an uncontrolled environment because of a "feature" of
    the underlying operating system/windowing environment.

    So my question is : is it imaginable to conceive a Swing app so that
    everytime a modal window pops up, all the other windows gives a
    visual clue, indicating that there's a modal windows opened somewhere ?

    I was thinking about "greying" automatically all the other windows (I mean,
    all the other windows of the Swing application of course, not all the
    windows of the other programs the operating systems may be running).
    Is it something that can be relatively easy done in Swing ?

    (If this can be done, the user would instantly notice that the application
    is not blocked nor "frozen" and would get used to the fact that this means
    that there's another windows "somewhere" that waits for inputs).

    How would you go to implement such a feature in a Swing application ? (I am
    not a Swing guru at all) ?

    Would it be possible to do something even more descriptive, like both
    greying the currently unavaible windows and displaying a message in red saying
    something like "This windows is unavailable until you have given
    input to the modal windows XXX" ? (say, in an normally invisible JLabel or
    whatever ?)

    Have you any ideas about a nice, clean way of doing this ?

    Thanks in advance,


    "I invented the term Object-Oriented and I can tell
    you I did not have C++ in mind." Alan Kay
    Jean Lutrin, Sep 17, 2004
    1. Advertisements

  2. "Jean Lutrin" <> wrote in message
    > ...
    > - for whatever reason, a modal window appears under the main frame
    > and the stays blocked until the user someone notice that there's
    > a window "underneath" is current window

    Is the main frame the parent of the modal dialogs? If not,
    making it so should eliminate most of these problems.
    Larry Barowski, Sep 18, 2004
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leila
    Apr 26, 2005
  2. Xah Lee
    Tim Roberts
    Mar 21, 2006
  3. Matt
    Jun 1, 2004
  4. Xah Lee
    Tim Roberts
    Mar 21, 2006
  5. Xah Lee
    Tim Roberts
    Mar 21, 2006