MattGoodwin
9/21/2018 - 8:26 AM

User Input Box

Create a user input textbox to allow the application to receive type input data from the user.

double userDiscount = Double.parseDouble(JOptionPane.showInputDialog(null, "Enter discount: "));

/*
double = data type
userDiscount = variable
Double.parseDouble = converts the input (string text) into double
(JOptionPane.showInputDialog(null, "Text to be displayed")); = uses JOptionPane package to display input box