albireo

Showing SWT modal dialog from AWT/Swing

爷,独闯天下 提交于 2019-12-11 10:51:44
问题 Using Albireo, it's easy to see how to show a Swing dialog from SWT: private AwtEnvironment awtEnv = AwtEnvironment.getInstance(Display.getCurrent); ... // call from SWT thread void showSwingMessageDialog(String msg) { awtEnv.invokeAndBlockSwt(new Runnable() { public void run() { Frame parentFrame = awtEnv.createDialogParentFrame(); JOptionPane.showMessageDialog(parentFrame, msg); } } } I want to show an SWT dialog from AWT thread, i.e. // call from AWT thread void showSWTMessageDialog(String