Fixed threading issues in the using of SWing

Threading done in the prescribed way and use of swing fixed.
No more hanging of windows.
Removed mac and windows specific code.

TODO : check whether it works fine on mac now.