I tried doing a simple animation code in
java:-
1. using inner class.
2. without using inner class.
1. code using inner class:-
2. Code without using inner classes:-
MyDrawPanel2 class:-
The oval is moving in the top left to bottom right direction in both cases except:-
1. In the case of inner class it starts at x,y=70,70 and ends exactly where i want it to end.
2.In the latter case it starts at an offset i.e. somewhere in the middle of the (300,300) window.
I have attached the snapshots of the full screen window. Why is there a bluish offset in the second case?
This is the first time I am posting a doubt so please bear with me if I have included it in the wrong place.