posted 20 years ago
The general idea is to check to see if altchoice is selected and then figure out your variables y and r based on what you discover. Then move into your calculating and finally into the displaying of monthly data.
Note the use of the arrays terms and rates as storage devices. You get the index of the selection in method and use this to collect your term and rate data.
Rewriting your program so that blocks of repeated code (used in different places or situations) appear only once is called refactoring.
Once your gui is onscreen all the action is focused in and through the event code. If you keep the code in the listeners simple and call methods to do the work it will make the logic easy to follow, design and understand.