Re: Modal Window Position?

Discussion in 'Java' started by Neomorph, Aug 16, 2003.

  1. Neomorph

    Neomorph Guest

    On Fri, 15 Aug 2003 20:12:19 GMT, BNM <> two-finger
    typed:

    >I am having an issue with modal windows in my Java Application.
    >If I go to another application while my Java Application is up with a
    >modal window, then return to the Java application by clicking on
    >another Window in the Java Application (The modal windows are the
    >smallest and thus less likely to be clicked on), my computer just
    >beeps at me because it wants me to be in the Modal Window.


    Yep. You have to put the focus back on the Modal window, not the
    application. In Windows you can do that with Alt-TAB if the modal window
    has disappeared behind the application somehow (and the mouse can't reach
    it).

    This situation also happens with MS Office 2000 on my system. Sometimes the
    File Dialog will open behind the main application window, and I have to
    Alt-TAB to it to bring it up.

    >
    >How do I automatically sense that we've returned to the Java
    >Application and bring the modal window to the front?


    The only way you return to an application is by clicking into it (into the
    modal window when it's up).
    You can catch that with a FocusListener on the modal window (the
    application will not be listening as long as the modal window is active).

    >
    >*note* Why haven't they fixed this idiot bug in Java yet? This would
    >be best handled by the VM rather than forcing us to do a workaround!


    It should be properly handled by the operating system (since underneath the
    Java classes these are still representative OS windows), but with Microsoft
    you have to live with your bugs, because they don't appear to care for
    these small nuisances... Have you tried Linux ?

    >
    >Thanks!
    >Brett


    Cheers.
    Neomorph, Aug 16, 2003
    #1
    1. Advertising

  2. In article <>,
    Neomorph <> wrote:

    >:On Fri, 15 Aug 2003 20:12:19 GMT, BNM <> two-finger
    >:typed:
    >:
    >:>I am having an issue with modal windows in my Java Application.
    >:>If I go to another application while my Java Application is up with a
    >:>modal window, then return to the Java application by clicking on
    >:>another Window in the Java Application (The modal windows are the
    >:>smallest and thus less likely to be clicked on), my computer just
    >:>beeps at me because it wants me to be in the Modal Window.
    >:
    >:Yep. You have to put the focus back on the Modal window, not the
    >:application. In Windows you can do that with Alt-TAB if the modal window
    >:has disappeared behind the application somehow (and the mouse can't reach
    >:it).
    >:
    >:This situation also happens with MS Office 2000 on my system. Sometimes the
    >:File Dialog will open behind the main application window, and I have to
    >:Alt-TAB to it to bring it up.
    >:
    >:>
    >:>How do I automatically sense that we've returned to the Java
    >:>Application and bring the modal window to the front?
    >:
    >:The only way you return to an application is by clicking into it (into the
    >:modal window when it's up).
    >:You can catch that with a FocusListener on the modal window (the
    >:application will not be listening as long as the modal window is active).
    >:
    >:>
    >:>*note* Why haven't they fixed this idiot bug in Java yet? This would
    >:>be best handled by the VM rather than forcing us to do a workaround!
    >:
    >:It should be properly handled by the operating system (since underneath the
    >:Java classes these are still representative OS windows), but with Microsoft
    >:you have to live with your bugs, because they don't appear to care for
    >:these small nuisances... Have you tried Linux ?
    >:
    >:>
    >:>Thanks!
    >:>Brett
    >:
    >:Cheers.


    None of this is an issue if you set the modal *dialog* (not window) to
    have the correct owner. In my app, which has only a single JFrame, a
    modal dialog is given a reference to that frame as its owner. Then,
    when I return to my app by clicking some visible portion of the main
    frame, I get a beep but I also get an immediate focus shift to the
    dialog.
    --
    Steve W. Jackson
    Montgomery, Alabama
    Steve W. Jackson, Aug 20, 2003
    #2
    1. Advertising

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
    Replies:
    0
    Views:
    406
    Leila
    Apr 26, 2005
  2. Matt
    Replies:
    1
    Views:
    3,139
    Whitecrest
    Jun 1, 2004
  3. Don
    Replies:
    0
    Views:
    350
  4. Matt
    Replies:
    0
    Views:
    217
  5. gopal srinivasan
    Replies:
    0
    Views:
    231
    gopal srinivasan
    Nov 5, 2004
Loading...

Share This Page