JClass Elements

PreviousNextIndex

25

Thread Safety Utilities

Features of the Thread Safety Classes  Methods


25.1 Features of the Thread Safety Classes

JCMessageHelper lets you build a message dialog based on JOptionPane. The advantages of the JCMessageHelper are:


25.2 Methods

JCMessageHelper

JCMessageHelper has static methods that resemble those in JOptionPane. These are:

showError()

Shows an error message, given a title and the message String as parameters.

showInformation()

Parameters are two Strings: title and message. The message appears in an information dialog.

showWarning()

Parameters are two Strings: title and message. The message appears in a warning dialog.

showMessage()

There is an optional first parameter that lets you specify a parent Component. The next two parameters are Strings, title and message. The next parameter is an int specifying the message type, and the optional last parameter is a Boolean that specifies whether to emit an audible beep when the dialog appears. The possible message types are javax.swing.JOptionPane.ERROR_MESSAGE

javax.swing.JOptionPane.INFORMATION_MESSAGE

javax.swing.JOptionPane.WARNING_MESSAGE

javax.swing.JOptionPane.QUESTION_MESSAGE

javax.swing.JOptionPane.PLAIN_MESSAGE

 

See javax.swing.JOptionPane for a description of the various dialogs.

JCSwingRunnable

run()

Since this class implements Runnable and is used to create a thread, its run() method will be called to start the thread.


PreviousNextIndex