wood burning stoves 2.0*
The moose likes Applets and the fly likes values changed, math didnt. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "values changed, math didnt." Watch "values changed, math didnt." New topic
Author

values changed, math didnt.

ken zemaitis
Ranch Hand

Joined: Sep 26, 2005
Posts: 42
Hi everyone, I've made a calculator that calculates the amount of calories burned during a workout, and body mass index. Most of the calculations work well, however, when the user changes their body weight, the calories burned calculation doesn't change. The JButtons I am using work fine the first time, however if you go back and change the weight value you input after the first calculation, the calculation doesn't change. Any help would be greatly appreciated as this is due very soon. Thank you very much.



[ UD: edited to break long lines into two for better formatting ]
[ April 25, 2007: Message edited by: Ulf Dittmer ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41164
    
  45
The variable 'amount' (where you indicate the problem is) only depends on the type of exercise and the length, not body weight and height, so it's not surprising that it doesn't change. The value of the weight shown in the line above that should change if the button is clicked, though.

As an aside, what are the ActionListeners supposed to do that are attached to the TextFields? It seems that all actions are handled by the buttons (which is a more intuitive way to do it, too).

Since, there is nothing applet-specific in this question, I'm moving it the AWT/Swing forum.


Ping & DNS - my free Android networking tools app
 
 
subject: values changed, math didnt.
 
Similar Threads
Help with getting program to compile.
GUI problem
FlowLayout issue
bmi calculation help please!
values changed, math didnt.