• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable is not sitting into JScrollPane

 
sudhakar ananth
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends

I am not able to get scrollpane's scrollbar horizontally

i am getting it virtually i mean. i able to see it but it is not working

i am getting it with scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);


but when i am running i am not able to see the "knob" at all ,buttons can be seen

pls help me how to scroll vertical....

vertically it is coming by default

bye,.
thank you very much friends...
 
sudhakar ananth
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the answer

i think when we are keeping the table into scrolpane
it tries to resize it self and because of this i think we are not able to see the knob when we can see the scroll bar(hori....)

so to get the knob we have make the table resize option false
so
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

us the solution...
 
sudhakar ananth
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if my assumption is wrong please rectify my bye friends
 
jad yuuu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use yourScrollPane.getViewport().setPreferredSize(new Dimension(1,1))..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!