java swing弹框显示问题

java swing弹框显示问题
2024-12-14 07:57:12
推荐回答(1个)
回答1:

你说的是messagedialog吧?
引用头文件:import javax.swing.JOptionPane;
showMessageDialog提示样式:
JOptionPane.showMessageDialog(null, "文字", "标题", JOptionPane.INFORMATION_MESSAGE);

showMessageDialog错误样式:
JOptionPane.showMessageDialog(null, "文字", "标题", JOptionPane.ERROR_MESSAGE);

showMessageDialog问号样式:
JOptionPane.showMessageDialog(null, "文字", "标题", JOptionPane.QUESTION_MESSAGE);

showMessageDialog普通样式:
JOptionPane.showMessageDialog(null, "文字", "标题", JOptionPane.PLAIN_MESSAGE);