0

Alright im really struggling here...

I have a multiple buttons that can be pushed and within the action listener i want the item added to my list model, and the running total to be incremented by the amount i specifiy within the actionperformed statement.

for whatever reason i am having the hardest time displaying this running total..

here is an example of my action listener

Object obj = ae.getSource( );
            if( obj == apples)
            {
                tally.addElement("Green Apples. . . . . . . . . . . . . $1.00");
                price = 1.00;
                dotheMath();

            }

Can anybody helpe me to figure out this simple problem??? what should i do to display this total?

***inside the dotheMath() function so far is only sale= sale + price **thus this is keeping track of the running total...

thanks

Edited by Nick Evan: Fixed formatting

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by thekashyap
0

What kinda application is this? JSP/Applet/..? When / where do you want to show the tally? On some button click as a msg box or continuously updated in some text area in the UI?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.