Originally Posted by makarov
Code:- if (e.getSource() == btnPay){
- int sum = 0;
- for (int i=0; i < pickedCars.length; i++){
- sum = (int)(sum+pickedCars[i].getValue()); txfTotalPrice.setText(" " + sum);
- }
-
Copy Code Is your array null? Nothing a simple System.out.println( ... ) can't tell ... Are the other variables having sane values? Again, System.out.println( ... ) can be of help ...
kind regards,
Jos
Code:
if (e.getSource() == btnPay){
int sum = 0;
for (int i=0; i < pickedCars.length; i++){
sum = (int)(sum+pickedCars.getValue()); txfTotalPrice.setText(" " + sum);
}
|