This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I had asked the same question at stackoverflow but didn't got any useful tips. The only difference is that here I have changed the JApplet to JFrame. Stackoverflow Link
What I need to do in program :There are total 2 buttons Circle and Square. When a user clicks on Circle button, the counter should count the number of times the Circle button has been clicked and draw that many circle. Thats fine. Now when the user clicks on Square button same thing should happen i.e. counting and drawing the squares and it works fine.
Now when again the user clicks on Circle button then the problem is that the previous circles drawn gets disappeared and it again starts from one.