Package org.jlab.io.ui
Class DialogUtilities
java.lang.Object
org.jlab.io.ui.DialogUtilities
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Dialog "Reason" constantstatic final int
Dialog "Reason" constantstatic final int
Dialog "Reason" constantstatic final int
Dialog "Reason" constantstatic final int
Dialog "Reason" constantprotected String
Current answer stringstatic final int
Dialog "Reason" constant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
centerDialog
(Component component) Center a dialogstatic JPanel
paddedPanel
(int hpad, int vpad, Component component) Create a nice padded panel.Convenience routine for padding a string using the default font.static int
yesNoDialog
(String prompt, String... options) Create a dialog with a prompt and a set of options
-
Field Details
-
OK_RESPONSE
public static final int OK_RESPONSEDialog "Reason" constant- See Also:
-
CANCEL_RESPONSE
public static final int CANCEL_RESPONSEDialog "Reason" constant- See Also:
-
outputdata
Current answer string -
APPLY_RESPONSE
public static final int APPLY_RESPONSEDialog "Reason" constant- See Also:
-
DONE_RESPONSE
public static final int DONE_RESPONSEDialog "Reason" constant- See Also:
-
YES_RESPONSE
public static final int YES_RESPONSEDialog "Reason" constant- See Also:
-
NO_RESPONSE
public static final int NO_RESPONSEDialog "Reason" constant- See Also:
-
-
Constructor Details
-
DialogUtilities
public DialogUtilities()
-
-
Method Details
-
centerDialog
Center a dialog- Parameters:
component
- the component to center
-
padString
Convenience routine for padding a string using the default font.- Parameters:
inp
- The string to be padded.tstr
- The test string-- try to return a string the same length
-
paddedPanel
Create a nice padded panel.- Parameters:
hpad
- the pixel pad on the left and rightvpad
- the pixel pad on the top and bottomcomponent
- the main component placed in the center.- Returns:
- the padded panel
-
yesNoDialog
Create a dialog with a prompt and a set of options- Parameters:
prompt
-options
-- Returns:
- a result indicating yes or no.
-