

import javax.swing.JOptionPane;

public class JOptionPaneDemo
{
   public static void main(String[] args)
   {
      String podString =
         JOptionPane.showInputDialog("Enter number of pods:");
      int numberOfPods = Integer.parseInt(podString);

      String peaString =
         JOptionPane.showInputDialog(
                               "Enter number of peas in a pod:");
      int peasPerPod = Integer.parseInt(peaString);

      int totalNumberOfPeas = numberOfPods*peasPerPod;

      JOptionPane.showMessageDialog(
         null, "The total number of peas = " + totalNumberOfPeas);

      System.exit(0);
   }
}
