Question: To answer this question, you may need to look up JOptionPanes showInputDialog and showConfirmDialog methods on Oracles Java API website. What does this program do?

To answer this question, you may need to look up JOptionPane’s showInputDialog and showConfirmDialog methods on Oracle’s Java API website. What does this program do?

import javax.swing.JOption Pane; public class Uncertain Hello { public static void main(String[] args). {

import javax.swing.JOption Pane; public class Uncertain Hello { public static void main(String[] args). { String name; int response; do { name = JOption Pane.show InputDialog("What's your name? "); response = JOption Pane.showConfirmDialog(null, "Are you sure?"); JOption Pane. NO OPTION) if (response { == name = "there"; break; } 3 while (response == JOption Pane. CANCEL_OPTION); System.out.println("Hello" + name); 3 // end main } // end class UncertainHello

Step by Step Solution

3.47 Rating (167 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The program uses Javas Swing library to interact with the user through a simple graphical user interface GUI Heres what the program does step by step ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction To Programming With Java A Problem Solving Approach Questions!