1JOptionPane d = new JOptionPane();
2d.showMessageDialog( laFrame, "le message",
3 "le titre", messageType);
4
1import javax.swing.ImageIcon;
2import javax.swing.JFrame;
3import javax.swing.JOptionPane;
4
5public class ShowMessageDialogExample1
6{
7 public static void main(String[] args)
8 {
9 String backupDir = "/Users/al/backups";
10
11 // create a jframe
12 JFrame frame = new JFrame("JOptionPane showMessageDialog example");
13
14 // show a joptionpane dialog using showMessageDialog
15 JOptionPane.showMessageDialog(frame,
16 "Problem writing to backup directory: '" + backupDir + "'.");
17 System.exit(0);
18 }
19}
20
1JOptionPane.showMessageDialog(frame, "A basic JOptionPane message dialog");
2
1JOptionPane.showMessageDialog(frame, "Eggs are not supposed to be green.");
2