Package ui.dialog
Class DialogUtils
java.lang.Object
ui.dialog.DialogUtils
Utility class for displaying common dialog boxes.
Provides convenience methods for error, info, and exception dialogs.
- Version:
- 1.0
- Author:
- Spectrometer Control Software
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidhandleError(JFrame frame, String message, Exception ex) Handles an exception by printing the stack trace and showing an error dialog.static voidshowErrorDialog(JFrame frame, String title, String message) Displays an error dialog with the specified title and message.static voidshowInfoDialog(JFrame frame, String title, String message) Displays an information dialog with the specified title and message.
-
Constructor Details
-
DialogUtils
public DialogUtils()
-
-
Method Details
-
showErrorDialog
Displays an error dialog with the specified title and message.- Parameters:
frame- the parent frame (can be null)title- the dialog titlemessage- the error message to display
-
showInfoDialog
Displays an information dialog with the specified title and message.- Parameters:
frame- the parent frame (can be null)title- the dialog titlemessage- the information message to display
-
handleError
Handles an exception by printing the stack trace and showing an error dialog.- Parameters:
frame- the parent frame (can be null)message- the error description messageex- the exception that occurred
-