• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 17. SWT Standard Dialogs > Using the SWT MessageBox Class

17.1. Using the SWT MessageBox Class

MessageBox is used to display some information to the user, such as an error condition, or to obtain simple input from the user, or both. The message box is displayed with a series of buttons, such as Yes, No, or Cancel. The program waits until the user makes a selection, then branches execution depending upon which selection was made.

17.1.1. How do I do that?

Perhaps the best example of using a MessageBox is seen when the user attempts to close an application by selecting File Exit from the program's menu. Often a message box will appear asking the user for confirmation before actually exiting. Example 17-1 demonstrates such a system.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint