|
Modifier and Type |
Static Method and Description |
 |
displayAsSheet   |
static void displayAsSheet(Window w,
Runnable closeHandler)
Display a window as a sheet, if possible.
public static void displayAsSheet(Window w,
Runnable closeHandler)
throws UnsupportedOperationException
-
Display a window as a sheet, if possible.
The behavior of a sheet is similar to a document modal dialog in that it prevents user interaction with the
existing windows in the hierarchy of the owner. Unlike setVisible(true) on a model dialog, however, this
method does not block waiting for the sheet to be dismissed. A sheet is dismissed when the window is hidden or
disposed.
- Parameters:
w - the window. The window must have a visible owner. The window must not be visible. If the window is a
dialog, its modality will be set to modeless.closeHandler - If not null, this object will be invoked when the sheet is dismissed.
- Throws:
UnsupportedOperationException - if the window could not be displayed as a sheet.
|
 |
showDialog   |
static void showDialog(JDialog d,
Runnable closeHandler)
Display a document modal dialog.
public static void showDialog(JDialog d,
Runnable closeHandler)
throws IllegalArgumentException,
HeadlessException
-
Display a document modal dialog. The dialog will be displayed as a sheet if possible.
This method may block until the dialog is dismissed, or it may return immediately.
- Parameters:
d - The dialog.closeHandler - If not null, this object will be invoked when the dialog is dismissed.
- Throws:
IllegalArgumentException - if the dialog is visible, the dialog has no owner, or the dialog owner is not
visible.
HeadlessException - if the graphics environment is headless.
|
 |
showFileChooserDialog   |
static void showFileChooserDialog(Component parent,
JFileChooser fc,
Consumer<Integer> resultConsumer)
Display a file chooser as a document modal dialog.
public static void showFileChooserDialog(Component parent,
JFileChooser fc,
Consumer<Integer> resultConsumer)
throws HeadlessException
-
Display a file chooser as a document modal dialog. If possible, the dialog will be displayed as a document modal
sheet. This method simulates the behavior of the showDialog method of JFileChooser .
This method may block until the dialog is dismissed, or it may return immediately.
- Parameters:
parent - The parent component. Its window will own the sheet.fc - The file chooser.resultConsumer - If not null, this object will be invoked upon dismissal of the dialog with the return state
of the file chooser.
- Throws:
HeadlessException - if the graphics environment is headless.
|
 |
showOpenDialog   |
static void showOpenDialog(Component parent,
JFileChooser fc,
Consumer<Integer> resultConsumer)
Display a file chooser as a document modal open dialog.
public static void showOpenDialog(Component parent,
JFileChooser fc,
Consumer<Integer> resultConsumer)
throws HeadlessException
-
Display a file chooser as a document modal open dialog. If possible, the dialog will be displayed as a document
modal sheet. This method simulates the behavior of the showOpenDialog method of JFileChooser .
This method may block until the dialog is dismissed, or it may return immediately.
- Parameters:
parent - The parent component. Its window will own the sheet.fc - The file chooser.resultConsumer - If not null, this object will be invoked upon dismissal of the dialog with the return state
of the file chooser.
- Throws:
HeadlessException - if the graphics environment is headless.
|
 |
showOptionPane   |
static void showOptionPane(Component parent,
JOptionPane pane,
String title,
Consumer<Integer> resultConsumer)
Display an option pane as a document modal dialog.
public static void showOptionPane(Component parent,
JOptionPane pane,
String title,
Consumer<Integer> resultConsumer)
throws HeadlessException
-
Display an option pane as a document modal dialog. The dialog will be displayed as a sheet if possible. This
method can be used to simulate the behavior of the various showXXX methods of JOptionPane.
This method may block until the dialog is dismissed, or it may return immediately.
- Parameters:
parent - The parent component. Its window will own the sheet.pane - The option pane.title - The title for the dialog if displayed as an ordinary dialog window.resultConsumer - If not null, this consumer will be called when the dialog is dismissed with an integer
indicating the option chosen by the user, or CLOSED_OPTION if the user dismissed the dialog without
choosing an option.
- Throws:
HeadlessException - if the graphics environment is headless.
|
 |
showSaveDialog   |
static void showSaveDialog(Component parent,
JFileChooser fc,
Consumer<Integer> resultConsumer)
Display a file chooser as a document modal save dialog.
public static void showSaveDialog(Component parent,
JFileChooser fc,
Consumer<Integer> resultConsumer)
throws HeadlessException
-
Display a file chooser as a document modal save dialog. If possible, the dialog will be displayed as a document
modal sheet. This method simulates the behavior of the showSaveDialog method of JFileChooser .
This method may block until the dialog is dismissed, or it may return immediately.
- Parameters:
parent - The parent component. Its window will own the sheet.fc - The file chooser.resultConsumer - If not null, this object will be invoked upon dismissal of the dialog with the return state
of the file chooser.
- Throws:
HeadlessException - if the graphics environment is headless.
|