shraddha , since your problem is not the same as the one in the nearly 3 year old
thread you posted in, I've moved it to a thread of its own.
To get better help sooner, post a
SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.
edit: Before that, read the API for JScrollPane and follow the link to the tutorial on How to Use Scroll Panes where you will learn how to correctly show a JTable or other component in a JScrollPane.