消息对话框
来源:互联网 发布:钢材重量计算软件 编辑:程序博客网 时间:2024/05/29 10:55
要使用对话框首先需要导入对话框的依赖库.不然找不到相应API。
主要通过NotifyDescriptor提供的Confirmation,Message,InputLine3个内部类来实现确认框,消息框,简单的输入框。
1.Confirmation
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
NotifyDescriptor nd = new NotifyDescriptor.Confirmation("测试", NotifyDescriptor.YES_NO_OPTION);
Object result = DialogDisplayer.getDefault().notify(nd);
if (NotifyDescriptor.OK_OPTION == result) {
} else {
}
2.Message
String msg = "test...";
NotifyDescriptor nd = new NotifyDescriptor.Message(msg, NotifyDescriptor.INFORMATION_MESSAGE);
DialogDisplayer.getDefault().notify(nd);
3.InputLine
NotifyDescriptor.InputLine input = new NotifyDescriptor.InputLine(txt, title);
input.setInputText("John Doe"); // specify a default name
Object result = DialogDisplayer.getDefault().notify(input);
if (result != NotifyDescriptor.OK_OPTION) {
return;
}
String userInput = input.getInputText();
- 消息对话框
- 消息对话框
- 消息对话框
- 消息对话框
- 消息对话框
- 常用对话框:消息对话框
- 对话框:消息对话框
- 文件对话框,消息对话框,确认对话框
- 消息对话框的使用
- 对话框中的消息函数
- swing 消息对话框
- 消息对话框的代码
- delphi的消息对话框
- javaMe开发消息对话框
- Qt4之消息对话框
- delphi的消息对话框
- 对话框响应WM_KEYDOWN消息
- VC++ 对话框消息传递
- VS2005的隐藏快捷键
- 最长公共子序列
- JVM 类装载器
- sql 时间处理
- 三层嵌套分页
- 消息对话框
- WINDOWS 字节对齐,很详细
- cf
- Kernel32.dll!BaseInitializeContext 反编译源码
- 【转】Java反射经典实例 Java Reflection Cookbook
- 在页面加载完毕时同时执行2段ajax代码 结果只能执行一段
- My97时间控件在ArtDialog控件中不显示
- 一些软件设计的原则
- UITabBarController使用