This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JTable in a JScrollPane Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "JTable in a JScrollPane" Watch "JTable in a JScrollPane" New topic
Author

JTable in a JScrollPane

glen kaatz
Greenhorn

Joined: Apr 29, 2001
Posts: 6
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

Joined: Oct 26, 2001
Posts: 2
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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: JTable in a JScrollPane
 
Similar Threads
JTable and Horizontal Scroll Bar
How to gray out one particular row in JTable
Last row in JTable not scrollable
JTable Problem - Urgent !!!!
jTable not scrolling