如何用java显示消息对话框
我想用java显示一个消息对话框。此时,我只能使用System.out.println()
方法在控制台中显示消息
例如:
public class demo{
public static void main(String[] x){
// i want to display the below message in a dialog box
System.out.print("java is fun");
}
}
# 1 楼答案
使用
JOptionPane.showMessageDialog()
方法,您可以定义该方法的一些或所有参数代码示例:
# 2 楼答案
使用此代码