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]);    

    }

}

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