Hi First of all let me tell you that my programming skill aren't great and I'm still learning java. Basically I'm trying to write a program that allow the user to enter a quantity in textfield1. Then when the confirm button is pressed, it'll display the result in textfield2
int amount = 35;
int quantity = Integer.parseInt(quantTxt.getText());
if e.getSource() == Confirm && quantity >= 1 ) message.setText(pounds.format((amount / 100.0) * quantity));
else {
message.setText(""); }
I know it isn't working as I tried it but I'd like to know if it is possible to perform this calculation differently.