how to use joptionpane in java code example
Example 1: java joptionpane
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class ShowMessageDialogExample1
{
public static void main(String[] args)
{
String backupDir = "/Users/al/backups";
JFrame frame = new JFrame("JOptionPane showMessageDialog example");
JOptionPane.showMessageDialog(frame,
"Problem writing to backup directory: '" + backupDir + "'.");
System.exit(0);
}
}
Example 2: java joptionpane
JOptionPane.showMessageDialog(frame, "A basic JOptionPane message dialog");
Example 3: java joptionpane
JOptionPane.showMessageDialog(frame, "Eggs are not supposed to be green.");