B
Basil Fawlty
I need help and suggestions on how to modify the below program to get two
numbers from user input using a input dialog box. B/c I'm a total newbie
with next to no programming experience, I'm not sure where to insert the
additional code. I'm using Forte for Java 3.0 CE. The below code does
compile and run. Please advise.
import javax.swing.*; // Make Swing available
public class sum2 extends java.lang.Object
{
public sum2() { // Creates new main
}
public static void main (String args[])
{
int intSum; // Holds the sum
intSum = 14 + 35; // Compute sum
JOptionPane.showMessageDialog(null, "The total is " + intSum); // Show
user the sum in a message window
System.exit(0); // Stops the execution
}
}
numbers from user input using a input dialog box. B/c I'm a total newbie
with next to no programming experience, I'm not sure where to insert the
additional code. I'm using Forte for Java 3.0 CE. The below code does
compile and run. Please advise.
import javax.swing.*; // Make Swing available
public class sum2 extends java.lang.Object
{
public sum2() { // Creates new main
}
public static void main (String args[])
{
int intSum; // Holds the sum
intSum = 14 + 35; // Compute sum
JOptionPane.showMessageDialog(null, "The total is " + intSum); // Show
user the sum in a message window
System.exit(0); // Stops the execution
}
}