Wednesday 25 June 2014

Java Program basic with dialog box


/*
 * 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 java2;


/**
 *
 * @author hamzakhanzadah
 */
import javax.swing.*;
public class Java2 {
    private static String JOptionsPane;

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
 
        // JOptoinPane for graphically Representation
     
        String input =      JOptionPane.showInputDialog("Please enter the number ");
     
        int number  = Integer.parseInt(input);
        JOptionPane.showMessageDialog(null, "The message is " +  number );
     
     
     
     
    }
 
}



Here is the basic program for the dialog box in which dialog box is open and we enter the number

and the number is shown in the message box ...

JOptionPane is used to show graphically

as the screenshots are showing below










No comments:

Post a Comment