//this shows how to convert string to upper case private void btnOKActionPerformed(java.awt.event.ActionEvent evt) { //---now decide the sales tax rate based upon the state they chose // be sure to include break statements when you are finished with the case blocks! double salesTaxRate = 0; String stateChosen = txtState.getText().toUpperCase(); //control for caps/lower case switch (stateChosen) //the thing we are testing { case "CA": salesTaxRate = .08; break; case "AZ": //here, AZ and NM are the same rate. We say AZ falls through (no break) case "NM": salesTaxRate = .05; break; case "NV": salesTaxRate = .01; break; case "OR": salesTaxRate = .06; break; default: //optional but a good idea to include it! JOptionPane.showMessageDialog(this, "Please enter CA, AZ, OR, NV", "Ron's Place", JOptionPane.INFORMATION_MESSAGE); break; }