SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL : SWT « org.eclipse.swt « Java by API






SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL


import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class MainClass {


  public static void main(String[] a) {
    Display d = new Display();
    Shell s = new Shell(d);
    s.setSize(500,500);
    s.open();
    DialogExample cs = new DialogExample(s);
    cs.open();

  }
}
class DialogExample extends Dialog {    
  DialogExample(Shell parent)
  {
      super(parent);        
  }
  public String open()
  {
      Shell parent = getParent(); 
      Shell dialog = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); 
      dialog.setSize(100,100);
      dialog.setText("A Dialog"); 
      dialog.open(); 
      Display display = parent.getDisplay(); 
      while (!dialog.isDisposed()) 
      { if (!display.readAndDispatch()) display.sleep(); 
      } 
      return "After Dialog";
  }
}
           
       








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.ESC
8.SWT.NO
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