public class DialogUtil extends Object
Constructor and Description |
---|
DialogUtil() |
Modifier and Type | Method and Description |
---|---|
static int |
confirm(Component parentComponent,
String msg)
Display a confirm dialog with YES, NO, CANCEL buttons and return
a JOptionPane constant indicating the choice.
|
static int |
confirm(String msg)
Display a confirm dialog with YES, NO, CANCEL buttons and return
a JOptionPane constant indicating the choice.
|
static void |
error(Component parentComponent,
Exception e)
Report an error message based on the given exception.
|
static void |
error(Component parentComponent,
String msg)
Report an error message.
|
static void |
error(Exception e)
Report an error message based on the given exception.
|
static void |
error(String msg)
Report an error message.
|
static JDesktopPane |
getDesktop()
This should be called if you want to use internal dialogs
|
static String |
input(Component parentComponent,
String msg)
Get an input string from the user and return it.
|
static String |
input(String msg)
Get an input string from the user and return it.
|
static void |
message(Component parentComponent,
String msg)
Display an informational message.
|
static void |
message(String msg)
Display an informational message.
|
static void |
setDesktop(JDesktopPane d)
This should be called if you want to use internal dialogs
|
public static void setDesktop(JDesktopPane d)
public static JDesktopPane getDesktop()
public static void error(Component parentComponent, String msg)
parentComponent
- display the dialog over the given componentmsg
- the error messagepublic static void error(String msg)
msg
- the error messagepublic static void error(Component parentComponent, Exception e)
parentComponent
- display the dialog over the given componente
- the exception containing the error informationpublic static void error(Exception e)
e
- the exception containing the error informationpublic static void message(Component parentComponent, String msg)
parentComponent
- display the dialog over the given componentmsg
- the messagepublic static void message(String msg)
msg
- the messagepublic static String input(Component parentComponent, String msg)
parentComponent
- display the dialog over the given componentmsg
- the message to displaypublic static String input(String msg)
msg
- the message to displaypublic static int confirm(Component parentComponent, String msg)
parentComponent
- display the dialog over the given componentmsg
- the message to displaypublic static int confirm(String msg)
msg
- the message to displayCopyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.