SWT.NO : SWT « org.eclipse.swt « Java by API






SWT.NO

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;

public class MainClass {

  public static void main(String[] a) {
    Shell s = new Shell();
    MessageBox messageBox = new MessageBox(s, SWT.ICON_QUESTION | SWT.YES | SWT.NO);
    messageBox.setMessage("Do you really want to exit?");
    messageBox.setText("Exiting Application");
    int response = messageBox.open();
    if (response == SWT.YES)
      System.out.println(SWT.YES);
    else if(response == SWT.NO)
      System.out.println(SWT.NO);

  }
}


           
       








Related examples in the same category

1.SWT.ARROW | SWT.LEFT
2.SWT.ARROW | SWT.LEFT | SWT.BORDER
3.SWT.ARROW | SWT.LEFT | SWT.FLAT
4.SWT.CHECK | SWT.BORDER
5.SWT.CHECK | SWT.FLAT
6.SWT.CR
7.SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL
8.SWT.ESC
9.SWT.RADIO
10.SWT.RADIO | SWT.BORDER
11.SWT.SHADOW_ETCHED_IN
12.SWT.TOGGLE | SWT.BORDER
13.SWT.TOGGLE | SWT.FLAT
14.SWT.YES