Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-1221015

Modal dialogs cannot return values to caller

XMLWordPrintable

    • 1.0.2
    • generic, sparc
    • generic, solaris_2.4
    • Verified

      Dialog objects created with modal = true are indeed modal, but there is no defined way for the creating thread to block and wait for the user to enter the desired input.

      Though you can create modal dialogs, they are not currently useful for anything. This is causing significant problems and delays in the implementation of new HotJava features.

      The description field as copied from bug report 1228840 follows:

      The FileDialog.show() method will block until the user has chosen a file.
      I can't figure out any way to write my own dialog (e.g., subclassed from
      Dialog) that will similarly block until dismissed by the user.

      I've tried using threads in many different combinations, but if I block
      the main thread waiting for the dialog thread, events don't get handled.

      Without this capability, I can't write a confirmation dialog that blocks
      waiting for the user to choose Yes or No. It's way too difficult to
      structure my application into pre-confirmation parts and event driven
      post-confirmation parts. It sure seems like threads should allow me to
      solve this problem, but I just can't figure out how.

            amfowler Anne Fowler (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: