Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package javafunwithdermot;
- import javax.swing.JOptionPane;
- /**
- *
- * @author Dermot
- */
- public class User_Input {
- public static void main(String[] args) {
- try
- {
- String first_name, second_name;
- first_name = JOptionPane.showInputDialog("Please Enter Your First Name");
- second_name = JOptionPane.showInputDialog("Please Enter Your Second Name");
- JOptionPane.showMessageDialog(null,
- "Your name is " + first_name + " " + second_name,
- "RESULT" , JOptionPane.INFORMATION_MESSAGE);
- System.exit(0);
- }
- catch (Exception Ex)
- {
- JOptionPane.showMessageDialog(null,
- Ex.getClass() + "\n\nCause: " + Ex.getMessage() +
- "\n\nError came From Line # " + Ex.getStackTrace()[0].getLineNumber(),
- "ERROR" , JOptionPane.ERROR_MESSAGE);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement