Well I want to use this try/catch in Java using the Execption in a program. Basically the program is aim to get the number/ amount of a certain product and it calculates its price and discount.
I want the txtAmount which is supposed to receive only numbers does not crash if put letters here is part of the code. Just a simple solution
public static String modelo, obsequio = null, resolucion = null;
public static int amount, numgift = 0, resolution = 0;
public static double amountourchase = 0, idiscount = 0, itopayr = 0, discount = 0, price = 0;
protected void actionPerformedBtnSell(ActionEvent arg0) {
inData();
calculateDiscount();
prrocessPurchase();
Results();
}
void indata(){
model = cboModelo.getSelectedItem().toString();
amount = Integer.parseInt(txtCantidad.getText());
}