When commenting a program, we usually try to not overcomment it. Obvious things should not be commented. You have written : // clac is the name of the class First, you've got the wrong class name in your comment (no big deal). But, no comment is better than a bad comment Second, such obvious things do not need to be commented.
Labeling variables is a start. But if you want to take this code apart to understand how it really works, I suggest that you look at each class separately. In other words, understand the different types of objects that work together in this program, examining their methods to understand what each class does.
Once you have the pieces figured out, then work through the path of execution -- looking at what is called when.
Also, there are depreciated methods here. If you compile with...
javac -Xlinteprecation PocketCalc.java
...you will generate a list of the depreciated methods. You should check the API to see what these methods have been replaced with. [ June 20, 2006: Message edited by: marc weber ]
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
(If this was submitted as an assignment, I expect a professor would recognize the code was not written in "modern" times, given the depreciated awt methods. A quick search of the internet would find several examples of this exact code.)