input ang message box

input ang message box

View Answers

July 15, 2009 at 11:17 AM

Hi Friend,

Try the following code:

import java.awt.*;
import javax.swing.*;

public class Calculate{
public static void main(String[] args)
{
String input1 = JOptionPane.showInputDialog("Input First Number");
int num1=Integer.parseInt(input1);
String input2 = JOptionPane.showInputDialog("Input second Number");
int num2=Integer.parseInt(input2);
int sum=num1+num2;
int diff=num1-num2;
int mul=num1*num2;
int quo=num1/num2;
JOptionPane.showMessageDialog(null,"Addition of numbers is: "+sum);
JOptionPane.showMessageDialog(null,"Difference of numbers is: "+diff);
JOptionPane.showMessageDialog(null,"Multiplication of numbers is: "+mul);
JOptionPane.showMessageDialog(null,"Quotient of numbers is: "+quo);
}
}

Thanks









Related Tutorials/Questions & Answers:
input ang message box - Java Beginners
input ang message box  can you help me to calculates for the sum, difference, product and quotient of the two inputted values using Input Dialog Boxes. Show the result with Message Dialog Boxes. Set the Message Dialog Box Type
input box
input box  give me the code of input box in core java
Advertisements
input box
input box  give me the code of input box in core java
message box
message box  How to show the message "invalid username and password" after redirecting the page to the login form
How to create an input box?
How to create an input box?  How to create an input box
Changing the message box to a specific color
Changing the message box to a specific color  How do you change the message box color to a specific color? I can get the color to change with each... the message box to red but its not really working. Can you help me
Java Message Box
. By message box we mean a box in which message is displayed or a box from which input.../No. showInputDialog : This will display a message box that accept input from...Java Message Box In this tutorials you will learn about how to create Message
Message Box Java
a message box that accepts input from user from text field or combo box... Message and Confirm Dialog Box - Swing Dialogs Show input dialog box...In this section we will create a message box in Java using a Java API class
Show input dialog box
Swing Input Dialog Box Example - Swing Dialogs       Input dialog box is very important... the text or the numeric values) in a normal window i.e. the Input Dialog Box
Java Message Box - Java Beginners
Java Message Box  I want to display the variable value in message box...); But the message box display nothing. Is there any way to display the value of s in message box. Please help me as soon as possible.  Hi
confirm message box - Java Beginners
confirm message box  How can I create a confirm message with Yes and No button instead of OK/Cancel buttons in java script inside a jsp?   ... Title', 'My Confirm Message', 2,0,0) if (retVal==true) return true; else
how do you change the message box to a specific color
how do you change the message box to a specific color  How do you change the message box color to a specific color? I can get the color to change... the message box to red but its not really working. Can you help me
Show message and confirm dialog box
Show Message and Confirm Dialog Box - Swing Dialogs... types of message box. There are three types of message dialog box that you can.... Once you click on the first button then the simple message box will open which
how to add save,discard,& cancel button in a message box - Struts
how to add save,discard,& cancel button in a message box  how to add save,discard,& cancel button in a message box
input type dialog box take text and search a list and focus that text - JSP-Servlet
input type dialog box take text and search a list and focus that text  i have a button..when i press it will prompt a dialog box with a text box... then it will search a list which contains data in the same page and if found
Show Dialog Box in Java
;    Message dialog box is used to display informative... the message Dialog box. Our program display "Click Me" button on the window and when user clicks on it program displays Message box with "OK"
input
input  a java program that will exchange the last names of two students that were input by a user
jQuery 'select' form event
input box. In this Example, two input text box are given , when we select something inside text box , it will display message "Some text...; Click and drag the mouse to select text in the input box. </p>
Flex Alert Box example
Flex Alert Box example       Alert box is a dialog box that appears on window with some message and stays rigid until the event associated with it is not done. Alert
Java Alert Box
JOptionPane class to display the message alert box.  JOptionPane class is available...Java Alert Box In this example we will describe java alert box. First of all we have created class than main method after that we have created alert box
Hollow Box
Box{ public void check(Scanner input,int key){ if(key<5... static void main(String[] args){ Box b=new Box(); Scanner input=new...Hollow Box  Write an application program that will draw a hollow box
difference between $message and $$message
difference between $message and $$message  What is the difference between $message and $$message?   Hi friends, $message is a simple variable whereas $$message is a reference variable. Example: $name = 'Bharat
What is the difference between $message and $$message?
What is the difference between $message and $$message?  What is the difference between $message and $$message
message passing
message passing  how message is passed using jade technology
input output
Input And Output       Introduction The Java I/O means Java Input/Output and is a part... character input stream and buffering characters. It also reads
Array and input
to input one of the above numbers then i want to print the array without the number user input. how will i do tht
JSF message Tag
in this box :<br>  <h:inputText id="input_text"...;    <h:message for="input_text" /><br>...;required" field is set to "true" for the input field. The message tag
keyboard input
keyboard input  how do I use JOptionPane to accept keyboard input? I know how to import but not specific command on input line   import javax.swing.*; class JOPtionPaneExample { public static void main(String
javascript focus input
reaches to the address input box automatically.  ... javascript focus input... input field in the page. It can be performed using focus() method on the html
input output
input output  java program using fileinputstream and fileoutputstream   Hi Friend, Try the following code: import java.io.*; class FileInputStreamAndFileOutputStream { public static void main(String[] args
input output
input output  java program using fileinputstream and fileoutputstream   Hi Friend, Try the following code: import java.io.*; class FileInputStreamAndFileOutputStream { public static void main(String[] args
Display alert box on clicking link
Display alert box on clicking link In this tutorial, we will display alert box to prompt message using jQuery. In the below program , html page contains a "a href" link. On clicking this link ,a alert box prompt message
How to take input by user using jDialogue and use that input
this button a dialogue box appear which take employee_id as input from user . then that input be used for fethcing data from the database ( desired table in DB...How to take input by user using jDialogue and use that input  I am
ModuleNotFoundError: No module named 'box-box'
ModuleNotFoundError: No module named 'box-box'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'box-box' How to remove the ModuleNotFoundError: No module named 'box-box
ModuleNotFoundError: No module named 'box-box'
ModuleNotFoundError: No module named 'box-box'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'box-box' How to remove the ModuleNotFoundError: No module named 'box-box
msg box in jsp
msg box in jsp  i need the source code to display the msgbox in jsp....but one condition is,i need to use it in the current page itself...now i use the message box means it prints it into another page...i need to resolve it plz
Popup dialog box in java
dialogs-user can customize dialog box. Here is a simple popup message dialog box...Popup dialog box in java  How to display popup dialog box in java?   Dialog Box- A dialog box is an independent small window which appear
store input and display previous input as well current input. in jsp
store input and display previous input as well current input. in jsp  Hi Friend, In this JSP program i want display the previous input as well current inputs also. currently only current input i am able to display whenever i
To Display the 'Last Modified' message in JSP
To Display the 'Last Modified' message in JSP  I have to display the "Last Modified" auto save message in a portlet page at the right end corner...; <td align="center"> <input type="text" size="3" maxlength="2" name
HTML in the box
HTML in the box  Can I use any HTML in the box
Java Message Services - JMS
Java Message Services  What is Java Message Services
escaping user input in php
escaping user input in php  Is it possible to escape the user input while submitting data into database in PHP
JavaScript Checkbox In DropDown box
JavaScript Checkbox In DropDown box In this section, you will learn how to display the checkboxes inside the dropdown box. Now to implement this, we have.... An alert box will display the selected values. Here is the code
Servlet Error Message based on user input
Servlet Error Message based on user input   ... the sucess message otherwise it displays the error message. So, you can use Servlet to check the user input against database and display the message to the user
drop down box - JSP-Servlet
drop down box  when i enter some letter in the input box,the corresponding words of that particular letter must be displayed below as a list from the data base in the same input box as drop down. Thanks&Regards, VijayaBabu.M
ModuleNotFoundError: No module named 'input'
ModuleNotFoundError: No module named 'input'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'input' How to remove the ModuleNotFoundError: No module named 'input'
select box and text box validations
select box and text box validations  hi, any one please tell me how to set validations for select box and text boxes using bean classes? thank you   Please visit the following link: http://www.roseindia.net/jsp/user
php date input calendar
php date input calendar  I'm having an issue while writing the date input calendar function in PHP.. any help? Thanks
Objective C Message Passing
Objective C Message Passing  What exactly a message passing means in Objective C? and how can i pass a message to a method
alert box in iphone
alert box in iphone  hello, how can i show alert box in my iphone application??   hello,ADS_TO_REPLACE_1 you can use this code for show..." message: @"Any massege" delegate: self cancelButtonTitle: @"Ok" otherButtonTitles

Ads