I've created a JOptionPane as a selection method. I want the int value for selection 1,2 or 3 of the String Array so I can use it as a counter. How do I get the index of the array and set it equal to my int variable loanChoice?
public class SelectLoanChoices {
int loanChoice = 0;
String[] choices = {"7 years at 5.35%", "15 years at 5.5%",
"30 years at 5.75%"};
String input = (String) javax.swing.JOptionPane.showInputDialog(null, "Select a Loan"
,"Mortgage Options",JOptionPane.QUESTION_MESSAGE, null,
choices,
choices[0]
**loanChoice =**);
}