Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JOptionPane;
- public class GuiBasics {
- public static void main(String[] args) {
- String name = JOptionPane.showInputDialog("Enter your name");
- JOptionPane.showMessageDialog(null,"Hello "+name);
- int age = Integer.parseInt(JOptionPane.showInputDialog("Enter your age"));
- JOptionPane.showMessageDialog(null,"You are "+age+ " years old.");
- double height = Double.parseDouble(JOptionPane.showInputDialog("Enter your height"));
- JOptionPane.showMessageDialog(null,"You are "+height+ " cm tall.");
- }
- }
Add Comment
Please, Sign In to add comment