In this example we are going to see how to use Java JOptionPane ShowInputDialog.
Java Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import javax.swing.*; public class Main { JFrame f; Main(){ f=new JFrame(); String name=JOptionPane.showInputDialog(f,"Enter Name"); } public static void main(String[] args) { new Main(); } } |
Output: