aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Scrollbars don't work on Jtable in a scrollpane w/tabbed panel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Scrollbars don Watch "Scrollbars don New topic
Author

Scrollbars don't work on Jtable in a scrollpane w/tabbed panel

Dennis Dougherty
Greenhorn

Joined: Jun 26, 2013
Posts: 3

I'm trying to build an app that is a query tool. I want the results put in a tabbed pane that contains a jtable with scrollbars. but my scrollbars don't work.

I'm kind of new to swing. Here is my sample code. I removed the table column adjuster to shorten up this post.



Thanks for the help.

Dennis
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4664
    
    5

Don't use a null layout. Learn to use layout managers effectively: http://docs.oracle.com/javase/tutorial/uiswing/layout/index.html

I removed the table column adjuster to shorten up this post.

When posting code to a forum, please remove inane IDE-generated comments and multiple blank lines, as they only add clutter.

There's no call for the frmJTableExample to be static.

Oh, and welcome to the Ranch!


luck, db
There are no new questions, but there may be new answers.
Dennis Dougherty
Greenhorn

Joined: Jun 26, 2013
Posts: 3

still doesn't work. but don't worry about it. I'll figure it out on my own.
Dennis Dougherty
Greenhorn

Joined: Jun 26, 2013
Posts: 3

Got it working.

Adding table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); after the instantiation of table got it to work.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scrollbars don't work on Jtable in a scrollpane w/tabbed panel