JAVA 中消息提示框

来源:互联网 发布:南木梁知 编辑:程序博客网 时间:2024/05/21 12:50

 JOptionPane.showMessageDialog(newFrame.getContentPane(),
"
弹出的是消息提示框!", "系统信息", JOptionPane.INFORMATION_MESSAGE);
JOptionPane.showMessageDialog(newFrame.getContentPane(),
"
弹出的是警告提示框!", "系统信息", JOptionPane.WARNING_MESSAGE);
JOptionPane.showMessageDialog(newFrame.getContentPane(),
"
弹出的是错误提示框!", "系统信息", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(newFrame.getContentPane(),
"
弹出的是询问提示框!", "系统信息", JOptionPane.QUESTION_MESSAGE);

int option = JOptionPane.showConfirmDialog(null,
       "文件已修改,是否保存?", "保存文件?", JOptionPane.YES_NO_OPTION,
       JOptionPane.WARNING_MESSAGE, null);
     switch (option) {
     case JOptionPane.YES_NO_OPTION: {
      saveAsFile();
      break;
     }
     case JOptionPane.NO_OPTION:
      System.exit(0);

     }

JAVA <wbr>中消息提示框

JAVA <wbr>中消息提示框

原文链接:http://blog.sina.com.cn/s/blog_aacdf4ce0102v1py.html

 

0 0