// bring the AWT dialog to the top. This happens if the
// dialog is given a null parent frame. When opened, the dialog
// can be hidden by the SWT window even when it obtains focus.
// Calling toFront() solves the problem.
focusOwner.requestFocus();
awtDialog.toFront();
} catch (NullPointerException e) {
// Some dialogs (e.g. Windows page setup and print dialogs on JDK 1.5+) throw an NPE on
// requestFocus(). There's no way to check ahead of time, so just swallow the NPE here.
}
}