Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

javax

import javax.swing.JOptionPane;    // Needed for Dialog Box

/**
 *   This program demonstrates
 *   showInputDialog.
 */
public class InputDialogDemo
{
   public static void main(String[] args)
   {
      String name;

      // Get the user's name.
      name = JOptionPane.showInputDialog("What is your name? ");

      // Display message
      JOptionPane.showMessageDialog(null, "Hello " + name);
   }
}
Source by www.beginwithjava.com #
 
PREVIOUS NEXT
Tagged: #javax
ADD COMMENT
Topic
Name
7+6 =