Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / February 2004

Tip: Looking for answers? Try searching our database.

JTabel and JScrollPane doens't scroll

Thread view: 
Falko Zurell - 05 Feb 2004 11:34 GMT
Hello,

I have a problem with a larger table.

I have a JTable whiches model contains 38 columns.

I put this Table in a JScrollPane. But on the screen there is no
scrollbar but a table with 38 very small columns.

I thought there must be a scroll bar for horizontal scrolling instead.

Are there any traps in this?

kind regards

Falko
Thomas Weidenfeller - 05 Feb 2004 11:39 GMT
> I put this Table in a JScrollPane. But on the screen there is no
> scrollbar but a table with 38 very small columns.
>
> I thought there must be a scroll bar for horizontal scrolling instead.

From the FAQ

> Christian Kaufhold's Java and Swing info (including JTable info):
>
>     http://www.chka.de/

And it was for sure discussed in the group a hundred times, too.

/Thomas
Falko Zurell - 05 Feb 2004 12:20 GMT
Yes, that's right.

But for the lazies here comes the solution:

JTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

thanks a lot

Falko

>> I put this Table in a JScrollPane. But on the screen there is no
>> scrollbar but a table with 38 very small columns.
[quoted text clipped - 10 lines]
>
> /Thomas
Todd Corley - 05 Feb 2004 16:58 GMT
Read the JTable api.

setAutoResizeMode()

Modes are:
AUTO_RESIZE_OFF,
AUTO_RESIZE_NEXT_COLUMN,
AUTO_RESIZE_SUBSEQUENT_COLUMNS,
AUTO_RESIZE_LAST_COLUMN,
AUTO_RESIZE_ALL_COLUMNS

Good Luck,
Todd


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.