JAVA中的訊息提示框
阿新 • • 發佈:2019-01-23
JAVA 中提供如下訊息提示框:
注意:如果報newFrame.getContentPane(),錯誤,則修改為null 即可
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);