aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes scrollbar not appearing in JTable put in JScrollPane? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "scrollbar not appearing in JTable put in JScrollPane?" Watch "scrollbar not appearing in JTable put in JScrollPane?" New topic
Author

scrollbar not appearing in JTable put in JScrollPane?

daman sidhu
Ranch Hand

Joined: Aug 19, 2000
Posts: 184
Hi Guys,
I have a problem, see if any one can help me out.
I am adding a JTable in a JScrollPane which is added to a JPanel in a JDialog. Now my JTable has over 170 rows but it is not showing the scrollbar, ie there are records below what rows are visible to me, but i cannot scroll down, i have set Autoscrolls(true) for both JTable as well as JScrollPane. Also i have set the Policy for JScrollPane's VerticalScrollBar to ALWAYS, it is showing me the scrollbar but not the slider on the bar?? Please help me out.
Thanks
Daman
george justin
Greenhorn

Joined: Jul 31, 2001
Posts: 25
Hi Sidhu
are u building u'r table from any model(Defaulttablemodel or abstracttable model) scroll bars automatically show up. If u r not getting the scrollbars then try to set.
setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
property of Jtable as JTable tend to resize itself
Cheers
George Justin
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: scrollbar not appearing in JTable put in JScrollPane?