Attachment 2773
hello . can somebody help me how can I add the numbers in quantity where it will automatically put in total?
im using netbeans.
just want the codes for how to add the listed quantity? hope you can help me
Printable View
Attachment 2773
hello . can somebody help me how can I add the numbers in quantity where it will automatically put in total?
im using netbeans.
just want the codes for how to add the listed quantity? hope you can help me
What have you tried?
i tried thisQuote:
jLabel8.setText(String.valueOf(Double.parseDouble( txtQuantity.getText()) + Double.parseDouble(txtQuantity.getText())));
What was the results?
i tried thisbut the Amount keeps changing into the quantity im putting it must be the sum of quantityQuote:
if(txtQuantity.getText().equals("")){
txtAmount.setText("");
}
else {
txtAmount.setText(String.valueOf(Double.parseDoubl e(txtQuantity.getText()) * 250));
--- Update ---
it should be like this . First, I will put quantity: 12 then the amount will be 250 * 12 = 3000 , but when i change it in any number example 124 the amount change but total must be 124 + 12 = 136 so i want it like that hope you understand my grammar is not good
If you want the total to be updated every time one of the values used to compute the total is changed, you will need to use a listener that can detect the change and recompute the total after the change is made.
hmmm.
what i mean is every time i input quantity it will keep adding and getting the sum. so that i can use that total in exchange for txtAmount.setText(String.valueOf(Double.parseDoubl e(*txtQuantity--this should be replace by the TotalQty*.getText()) * 250));
Can you make a small, simple program that compiles, executes and shows the problem?