Browse Prior Art Database

Blocking Modal Dialog Support for Java

IP.com Disclosure Number: IPCOM000118634D
Original Publication Date: 1997-Apr-01
Included in the Prior Art Database: 2005-Apr-01
Document File: 2 page(s) / 63K

Publishing Venue

IBM

Related People

Boldt, GD: AUTHOR [+7]

Abstract

Disclosed is a method for creating blocking modal dialog boxes used in Graphic User Interfaces (GUI). A blocking modal dialog box has two salient features: 1. It prevents user input from going to any other dialog/window that is displayed by the current application. 2. It does not return control to the calling routine until a button is pressed on the dialog.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Blocking Modal Dialog Support for Java

      Disclosed is a method for creating blocking modal dialog boxes
used in Graphic User Interfaces (GUI).  A blocking modal dialog box
has two salient features:
  1.  It prevents user input from going to any other
       dialog/window that is displayed by the current application.
  2.  It does not return control to the calling routine until a
       button is pressed on the dialog.

      A message box that asks "Do you want to continue?" and has
"Yes" and "No" buttons is a simple example of a blocking modal
dialog.

      The Java language (JDK 1.0.2) provides a Dialog class that
initially appears to have blocking modal capabilities, but it does
not.  The Dialog class has a constructor that accepts a Boolean value
for a variable called modal (i.e., public Dialog(Frame parent,
boolean modal); ).  When this bit is set, the new dialog is modal,
but it does  not block and wait for a response.

      Instead, blocking must be done by halting the current thread of
execution until a button is pressed.  In Java, the execution of a
thread can be halted via the wait() or suspend() methods.  Execution
will begin  again once a notify() or resume() method respectively is
executed in a  different thread.

The thread blocking is represented diagrammatically in Example 1.
  Thread 1 --------> 1) Determine that a blocking modal dialog
                         is needed
                     2) Display blocking modal dialog
                     3) Block
  Thread 2 --------> 4) Handle button push
                     5) Store what button was pushed
                     6) Dismiss modal blocking dialog
                     7) Unblock Thread 1
  Thread 1 --------> 8) Read what button was pushed
                     9) Determine operation depending on button
                         pushed

Example 1 Java Blocking Modal Dialog Scheme

      The scheme described above works in all Java GUIs...