Some Interactive tips to take input form GUI Dialogs

import javax.swing.*;

class Dialog
{
    public static void main(String[] args)
    {
        JOptionPane.showMessageDialog(null,"Enter the two numbers");
        int x=Integer.parseInt(JOptionPane.showInputDialog("Enter first number"));
        int y=Integer.parseInt(JOptionPane.showInputDialog("Enter second number"));
        int z=x+y;
        JOptionPane.showMessageDialog(null,"Sum : " + z);
       
    }
}








Comments

Popular posts from this blog

How to set background color of navigation bar in iPhone

Checking Device Info in ios