java中的JS风格警报框

时间:2012-06-16 17:13:29

标签: java swing popup alert

JavaScript alert()弹出窗口的Java Swing对应物(如果有的话)是什么?

3 个答案:

答案 0 :(得分:7)

完成此类弹出窗口的基本方法是使用JOptionPane.showMessageDialogsee here

JOptionPane.showMessageDialog(frame, "here comes the text.");   
// assumes frame to be a reference to the desired parent frame

答案 1 :(得分:2)

认为您正在寻找JOptionPanes,但这里是对不同对话框的一个很好的描述: http://docs.oracle.com/javase/tutorial/uiswing/components/dialog.html

答案 2 :(得分:2)

如何在Java中创建对话框:

相关问题