DEV Community

Arshad Ali
Arshad Ali

Posted on

JAVA-Graphical user interface (GUI) Intro

import javax.swing.JOptionPane;

public class Main {

    public static void main(String[] args) {

        String name = JOptionPane.showInputDialog("Enter Your Name");
        JOptionPane.showConfirmDialog(null,"Hello"+name);

        int age = Integer.parseInt(JOptionPane.showInputDialog("Enter Your Age"));
        JOptionPane.showConfirmDialog(null,"Your age"+age);

        double height = Double.parseDouble(JOptionPane.showInputDialog("Enter Your Height"));
        JOptionPane.showConfirmDialog(null,"You are"+height);

    }


}



Enter fullscreen mode Exit fullscreen mode

Top comments (0)