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


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

Can you lock a dialog and continue?

Newsgroups comp.lang.java.programmer
Date 2017-06-30 10:35 -0700
Message-ID <34333fbb-4b83-454b-9395-4efaa019e95e@googlegroups.com> (permalink)
Subject Can you lock a dialog and continue?
From Eric Douglas <e.d.programmer@gmail.com>

Show all headers | View raw


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.  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).

public class WindowTest {
     public static void main(String[] args) {
          EventQueue.invokeLater(new Runnable() {

               @Override
               public void run() {
                    JDialog win1 = new JDialog();
                    win1.setVisible(true);
                    System.out.println("win 1 visible");
                    JDialog win2 = new JDialog(win1,true);
                    win2.setVisible(true);
                    System.out.println("win 2 visible");
               }
               
          });
     }

}
Displays 2 windows, then prints a second message only after you close the second window.

Back to comp.lang.java.programmer | Previous | Next — 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