登 录
MessageDialog.openInformation(null, "测试", "Hello,测试!");
顺便提一下SWT Widgets的MessageBox的使用,在创建了MessageBox,并设置了Text与Message后,记得一定要open一下啊~不然消息对话框不会出来的~
再贴一段Jface的InputDialog的代码:
InputDialog dialog = new InputDialog(Display.getCurrent().getActiveShell(), "Enter new id", "New Id", newValue, new IInputValidator() { public String isValid(String newText) { if (newText == null || newText.length() == 0) { return "Please enter a value"; } return null; } }); if (dialog.open() == IDialogConstants.OK_ID) { newValue = dialog.getValue(); } else { return null; }
抱歉!评论已关闭.