Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable in a JScrollPane

 
glen kaatz
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I noticed that I can resize the columns in a JTable - but I also noticed that the JScrollPane doesn't add a horizontal scroll when the column is sized (dragged) outside the viewport. How would I get it to slap on the horizontal scroll?
Thanks. I love you man!
 
Shardool Karnik
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can set the property
jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
or
javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED
or
javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER
this should work I think ....
good luck!
- DooL
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic