| java.lang.Object edu.hws.jcm.awt.MessagePopup
MessagePopup | public class MessagePopup implements ActionListener,ErrorReporter(Code) | | The class MessagePopup represents a Window that pops up to display an error
message. A MessagePopup object is created by a "source" component. If
that component is contained in a Frame, then the popup will be a modal dialog
box with that Parent. If the component is not in a Frame (or is null), then an
independent Frame is used. The message box is popped up when reportError() is
called. It is closed either when the user clicks the OK button,
or if clearErrorMessage() is called.
|
Constructor Summary | |
public | MessagePopup(Component source) Create a MessagePopup with the give source component. |
MessagePopup | public MessagePopup(Component source)(Code) | | Create a MessagePopup with the give source component. If source is null, then
an independent window will always be used to show the error message.
|
actionPerformed | public void actionPerformed(ActionEvent evt)(Code) | | Respond when user clicks OK. This is not meant to be called directly.
|
clearErrorMessage | public synchronized void clearErrorMessage()(Code) | | Clear the error message and close the window. This can be
called from outside this class. It is called automatically
when the user clicks the OK button or close box of the window
that displays the error message.
|
getErrorMessage | public String getErrorMessage()(Code) | | Get the currently displayed error message. The return value is null if no error message is being displayed.
|
setErrorMessage | public void setErrorMessage(Controller c, String message)(Code) | | Show the given message in a dialog box or independent window,
depending on whether the source component is contained in
a Frame or not.
Parameters: c - The Controller that calls this method, or null if it is not called by a Controller.(The Controller, if any, will be notified when the error message is cleared.) Parameters: message - The message to display. |
|
|