Hello there sagar
Cant quite give you source code, but a fellow named stanislav has created some very interesting examples to do what you want but with JTextComponents. From what I have seen with the examples a little bit of tinkering should be able to get the same thing happening for JTable as well.
Best of luck here is the site:
http://java-sl.com/articles.html
Jason Barraclough.