• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

scrollbar not appearing in JTable put in JScrollPane?

 
daman sidhu
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic