The following JOptionPane input dialog displays a question-message dialog to the use and returns the user response as String.

Java Code:
String language= JOptionPane.showInputDialog(null, 
              "Which programming language you use?");