// create about dialog
final Display display = browser.getShell().getDisplay();
final Shell shell = new Shell(browser.getShell(), SWT.DIALOG_TRIM
| SWT.APPLICATION_MODAL);
// create widgets
final SWTXHTMLRenderer xhtml = new SWTXHTMLRenderer(shell, SWT.NONE,
new BrowserUserAgent(display));
final Button close = new Button(shell, SWT.PUSH);
close.setText("Close");
shell.setDefaultButton(close);
close.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
shell.dispose();
}
});
// layout
shell.setLayout(new FormLayout());
FormData fd;
fd = new FormData();
fd.top = new FormAttachment(0);
fd.left = new FormAttachment(0);
fd.right = new FormAttachment(100);
fd.bottom = new FormAttachment(close, -5);
xhtml.setLayoutData(fd);
fd = new FormData();
fd.right = new FormAttachment(100);
fd.bottom = new FormAttachment(100);
close.setLayoutData(fd);
shell.setSize(500, 450);
// load page
xhtml.setDocument(ABOUT_URL);
// open dialog
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();