JOptionPane.showMessageDialog(null, "Hello, World!");
JOptionPane.showMessageDialog(
null,
"Hello, World!",
"Message",
JOptionPane.INFORMATION_MESSAGE,
new ImageIcon("globe.gif"));
MessageTest.java
import javax.swing.*; public class MessageTest { public static void main(String[] args) { JOptionPane.showMessageDialog(null, "Hello, World!"); System.exit(0); } }
IconTest.java
import javax.swing.*; public class IconTest { public static void main(String[] args) { JOptionPane.showMessageDialog( null, "Hello, World!", "Message", JOptionPane.INFORMATION_MESSAGE, new ImageIcon("globe.gif")); System.exit(0); } }
Maintained by John Loomis, updated Thu Feb 22 09:41:42 2007