Logo 
Search:

Java Articles

Submit Article
Home » Articles » Java » Applet programsRSS Feeds

Dialog Boxes

Posted By: Falak Khan     Category: Java     Views: 14190

Code for Dialog Boxes in Java

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

    /**     * @param args the command line arguments     */publicstaticvoid 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]);    

    }
    
}
  
Share: 


Didn't find what you were looking for? Find more on Dialog Boxes Or get search suggestion and latest updates.

Falak Khan
Falak Khan author of Dialog Boxes is from Pakistan.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!