Question: Hello, Can you please delete the cancel button in this program? It serves no function. ADDINTEGERS class package project.pkg6_23; import javax.swing.JOptionPane; /** * * @author

Hello, Can you please delete the cancel button in this program? It serves no function.

ADDINTEGERS class

package project.pkg6_23;

import javax.swing.JOptionPane;

/** * * @author user */ public class AddIntegers { public AddIntegers() { String userInput = "yes"; while (userInput.equalsIgnoreCase("yes")) { try { String userInput1 = JOptionPane.showInputDialog ("Please enter an integer. "); String userInput2 = JOptionPane.showInputDialog ("Please enter another integer. "); int userInt1 = Integer.parseInt(userInput1); int userInt2 = Integer.parseInt(userInput2); System.out.println(); userInput = JOptionPane.showInputDialog ("The sum of the two numbers you entered in is: " + (userInt1 + userInt2) + " The product of the two numbers you entered in is: " + (userInt1 * userInt2) + " If you want to add and multiply two new integers," + " press yes (case does not matter). If not," + " press anything else. "); } catch (Exception e) { JOptionPane.showMessageDialog(null, "Please enter int numbers " + "only."); } } } }

MAIN CLASS:

package project.pkg6_23; //Imports neccessary imports import javax.swing.*; /** * @author user */ public class Project6_23 { public static void main(String[] args) { new AddIntegers(); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!