I am glad you answered first Mr Friedman-Hill.
Welcome to the Ranch, Mithravedi Ramachandran.
I considered running your app earlier to see whether I could replicate the hanging,
but it would have been impossible because I lack some of the resources,
viz the .gif and .bat files.
Please try out EFH's suggestions.
If they don't work, I think you are going to have to do it the hard way. Put
the entire code onto an
IDE (Eclipse, NetBeans, etc), and set a breakpoint.
Anywhere. You click on the left margin, alongside a line, where the line numbers are, and you get a little round blob which represents the breakpoint.
At this point you discover a major difference between Eclipse and NetBeans:
Eclipse breakpoints are blue and NetBeans breakpoints (if I remember correctly) ARE RED.
Then don't run the code normally, but use the "debug" option.
The code will run until control reaches the line with the breakpoint. On all
debuggers, you now have three options:-
Step into. This means a normal method call; you go into the method and can observe what is happening.Step over. Go to the next line from wherever you are. If there is a method call, this is completed without your seeing the details.and, Step return. Skip seeing the details of the method you are in at present, and back to the previous method.At any point during the proceedings, you can inspect the object, all its instance and local variables, etc.
That may help you see where you are going, and what is going wrong.
If I were marking your project (be grateful I am not
) you would lose marks for poor code style;
I don't think b1 b2 b3 fulfil the requirement that
you should be able to tell what every identifier means by reading its name.
Also if I were marking you would lose marks for the use of AddActionListener(this)
passim.
The length of your actionPerformed() method and the number of else-if blocks in it are an object lesson
in why addActionListener(this) does not constitute good object-oriented programming.
You will have to learn how to write actionListeners for each individual button.
I have posted on that subject several times in the past, but can't find them now; try a search with my ID 109202.
Hope that is of some help.
CR
Edited for minor spelling and formatting errors only.
[ February 25, 2007: Message edited by: Campbell Ritchie ]