FileDocCategorySizeDatePackage
AboutDialog.javaAPI DocExample1331Sun Oct 31 09:43:44 GMT 2004None

AboutDialog

public class AboutDialog extends org.eclipse.swt.widgets.Dialog

Fields Summary
Constructors Summary
AboutDialog(org.eclipse.swt.widgets.Shell parent)

        super(parent);        
    
Methods Summary
public voidopen()

        Shell parent = getParent(); 
        final Shell dialog = new Shell(parent, SWT.DIALOG_TRIM 
                | SWT.APPLICATION_MODAL);
        dialog.setSize(200,100);
        dialog.setText("About"); 
        final Label l = new Label(dialog, SWT.NONE);
        l.setText("An SWT Text Editor");
        l.setBounds(43, 20, 100, 20);
        Button b = new Button(dialog, SWT.PUSH | SWT.BORDER);
        b.setText("OK");
        b.setBounds(80, 45, 40, 25);
        b.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                dialog.dispose();
            }
        }); 
        dialog.open(); 
        Display display = parent.getDisplay(); 
        while (!dialog.isDisposed()) 
        { if (!display.readAndDispatch()) display.sleep(); 
        }