Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Dennis Dougherty
Greenhorn
Posts: 3
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Dennis Dougherty
Greenhorn
Posts: 3
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
still doesn't work. but don't worry about it. I'll figure it out on my own.
 
Dennis Dougherty
Greenhorn
Posts: 3
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it working.

Adding table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); after the instantiation of table got it to work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic