This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable" Watch "JTable" New topic


Don Lyman

Joined: Jan 05, 1999
Posts: 2
Seems to me JTable is still a dog when you have a large number of rows even in Java 2. Does this jive with your experience?
Gary Fidler

Joined: Feb 12, 1999
Posts: 4
I assume you mean a dog when adding many rows to the table. Try this: (sorry I don't have my code example handy)
Instead of adding rows one at a time to the JTable using new Vectors, add new String[] to the underlying data model and then notify the JTable that its data has changed. MUCH faster!
Jim McCabe

Joined: Mar 24, 1999
Posts: 8
I don't think it's the JTable itself but the default table model. Try making your own model. As a test, a couple months ago, I wrote a table model that had 100,000 rows and the JTable didn't slow down at all.
Don Lyman

Joined: Jan 05, 1999
Posts: 2
Thanks for the suggestions.
I agree. Here's the link:
subject: JTable
It's not a secret anymore!