Java Tutorial

 
 
 
 
package dialogboxes;
import  javax.swing.JOptionPane; 
import  javax.swing.JFrame;
/**
 *
 * @author Hira
 */
public class Dialogboxes {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
   //   JOptionPane.showMessageDialog(null,
   // \"Eggs are not supposed to be green.\");
  //  }
      Object[] options = {\"Yes, please\",
                    \"No, thanks\",
                    \"Never!,\",\"Later! \"};
    int n=JOptionPane.showOptionDialog(null,
    \"Would you like system to remember password? \",
    \"Remember Password?\",
    JOptionPane.YES_NO_CANCEL_OPTION,
    JOptionPane.QUESTION_MESSAGE,
    null,
    options,
    options[2]);    

    }

}

    Related Post:
  1. Program to show the use of Nested If-Else Statements

  2. Program to search an element in an array using Linear Search

  3. Program to print a string on Standard Output Device

  4. Program to show the use of some Character Methods

  5. Pass the marks of 10 students from the client side design a servlet, which takes these marks and returns the number of students who obtained first cls

  6. An applet program to display moving banner

  7. Program to read rollno, marks of sub1,sub2 and sub3 and on basis of that display result

  8. Program to generate SQUARE ROOT table

  9. An applet program of showing new document using showDocument(URL) method

  10. Program to show an example of using constructors in a class to initialize its data members

  11. Program to show an example of Polymorphism

  12. Program to show an example of overloading constructors in a class to initialize its data members

  13. Program to read the price of an item in decimal form (like 75.95) and print the output in paise (like 7595 paise).

  14. Program to show the use of Bitwise Operator (|) OR

  15. RMI based application, which reads a file with list of marks of student from a client, send it to server and find how many students having distinct

  16. Program to reverse the number eg given no : - 12345, output want :- 54321

  17. Program to show an example of using initialization block to initialize the data members of a class

  18. Program to display Floyds Triangle of a numbers

  19. CORBA PROGRAM TO GET THE HTML CODE FROM ANY URL

  20. Develop a CORBA based application for addition of two complex numbers and displaying the result on client side

 
 
Didn't find what you were looking for? Find more on Dialog Boxes