Java中的消息框

 

 

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>中消息提示框

 

摘自般若离弦的博客

posted @ 2017-03-30 10:35  太潮了就要晒  阅读(593)  评论(0编辑  收藏  举报