I & my friend doing one program, 'many small Jpanels can drag-drop in one Big JPanel'.
I am just very bad pretender of
java programmer & he is very well set java programmer. My work is as, he is highly professional so not had time to spend such program so, i find out ways & show him.
I spend almost 3-4 months to achieve what we want, he spend only half days(few hours) after reading my code.
Then he show me how to write code smartly.
By doing this exercise, i learn
1. how to write code smartly.
2. How to think smartly when developing logic.
3. Gain confidence for to solve more difficult java problem.
But in my mind question remains why not at firstly i can do smartly. or what i done is waste of time?
Here you might be think all this is only theoretical question not related to java or swing...
For reference I am attaching class Dragger which i develop & he edited
1. Class Dragger which i developed
2ndly he Edited class Dragger as below:-
In my code i check each & very possibility which i think it will occur when we use program. But his code also works as needed.
So my moral is go down...Any guidance regarding this. Why not my code is smart or where i done mistake?