package test;import javax.swing.JOptionPane;public class test { public static void main(String[] args){ JOptionPane.showMessageDialog(null,"HelloWorld!", "Title",JOptionPane.INFORMATION_MESSAGE); }}JOptionPane.showMessageDialog(null,"Welcome to Java!", //显示的内容"Display Message", //标题JOptionPane.INFORMATION_MESSAGE 显示倒感叹号图标);调用showMessageDialog方法有两种方式:x 是要显示的字符串一:JOptionPane.showMessageDialog(null,x, "Title",JOptionPane.INFORMATION_MESSAGE);二:JOptionPane.showMessageDialog(null,x);
新闻热点
疑难解答