Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #36781

Re: Can you lock a dialog and continue?

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Can you lock a dialog and continue?
Date 2017-06-30 14:24 -0400
Organization A noiseless patient Spider
Message-ID <oj64pn$b1s$1@dont-email.me> (permalink)
References <34333fbb-4b83-454b-9395-4efaa019e95e@googlegroups.com>

Show all headers | View raw


On 6/30/2017 1:35 PM, Eric Douglas wrote:
> I can display a window of type JDialog and keep running code, but if I display another one modal to that one to lock it, the code just freezes as soon as I make it visible until it's closed.

     Um, er, that's what a "modal" dialog is supposed to do.  Consider
an input-gathering dialog, like one where the user chooses "Proceed"
vs. "Cancel."  The code shows the dialog, *waits until it closes*,
and collects the chosen answer.

     If you don't want to wait, use a modeless dialog.

> I was hoping to use this to pop up a window to show the user a processing status with a JProgressBar so they can't interact with the first window while the program updates it (need to do a background task to get data then populate the window).

     It's possible that I've failed to understand what you want to do,
but ... have you investigated javax.swing.ProgressMonitor?

-- 
esosman@comcast-dot-net.invalid
Thirteen hundred days to go.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Can you lock a dialog and continue? Eric Douglas <e.d.programmer@gmail.com> - 2017-06-30 10:35 -0700
  Re: Can you lock a dialog and continue? Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-06-30 14:24 -0400
  Re: Can you lock a dialog and continue? Eric Douglas <e.d.programmer@gmail.com> - 2017-06-30 11:34 -0700
    Re: Can you lock a dialog and continue? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2017-06-30 14:33 -0500
      Re: Can you lock a dialog and continue? Eric Douglas <e.d.programmer@gmail.com> - 2017-06-30 13:19 -0700
        Re: Can you lock a dialog and continue? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2017-06-30 15:35 -0500
          Re: Can you lock a dialog and continue? Eric Douglas <e.d.programmer@gmail.com> - 2017-06-30 13:56 -0700
        Re: Can you lock a dialog and continue? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2017-06-30 15:40 -0500
          Re: Can you lock a dialog and continue? Eric Douglas <e.d.programmer@gmail.com> - 2017-06-30 13:52 -0700
            Re: Can you lock a dialog and continue? Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-30 21:14 +0000
            Re: Can you lock a dialog and continue? Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-06-30 17:19 -0400

csiph-web