Results 1 to 7 of 7
Thread: jtable showing limited rows
- 04-25-2011, 06:46 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 84
- Rep Power
- 0
jtable showing limited rows
Hi,
I have jtable which shows only a limited rows(353) when data is large.
I checked database is returning 899 rows but my jtable only shows 353 rows .
Does jtable has a size limitation or is there any property for jtable which sets the maximum number of rows?
Please help.
Thanks
- 04-25-2011, 08:14 PM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,608
- Rep Power
- 5
See How to Use Tables (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)
In particular, the section regarding writing a TableModel (and the getRowCount() method of TableModel (Java Platform SE 6))
- 04-25-2011, 08:20 PM #3
Member
- Join Date
- Feb 2011
- Posts
- 84
- Rep Power
- 0
Thanks for your reply.
I did system.out.println(table.getRowCount) .It is showing the row count as 899 same as that returned from the database but it displays only 353.
My jtable is within a jscrollpane.I have checked the properties such as verticalscrollbar is set as AS_Needed but I am not able to scroll after 353 row.
Please help.
Thanks,
Manshu
- 04-25-2011, 09:24 PM #4
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,143
- Rep Power
- 5
Why are you still asking questions without posting a SSCCE. The problem is with your code, not JTable.
Create a simple program that loops 1,000 times and add rows of data to the TableModel and then add the table model to the JTable. Prove that it works, then determine what is different from your working code and your real program.
There is no way we can guess your mistake.
- 04-26-2011, 02:21 PM #5
Member
- Join Date
- Feb 2011
- Posts
- 84
- Rep Power
- 0
Thanks for your reply.
I tried with a for loop .All rows areshown fine but when it comes to displaying ,its showing only 353 rows.I think it is because of JscrollPane size or some property.
I have tried changing the size but it doesnt help.
Thanks,
- 04-26-2011, 02:45 PM #6
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,608
- Rep Power
- 5
To reiterate camickr's advice...post an SSCCE. We're left guessing otherwise.
- 04-26-2011, 06:29 PM #7
Member
- Join Date
- Feb 2011
- Posts
- 84
- Rep Power
- 0
Its fixed now.The problem is not in the tablemodel but with the preffered size for the table. Refer
JScrollPane (Java 2 Platform SE v1.4.2)
If the table preffered size is small it would not be accomodated in the scrollpanes view.
Thanks,
Similar Threads
-
Jtable rows
By riddhishah28 in forum AWT / SwingReplies: 3Last Post: 02-18-2011, 06:24 AM -
How to Add,Remove Rows in JTable
By Dinesh_rockz in forum AWT / SwingReplies: 2Last Post: 02-03-2011, 05:30 AM -
Remove Jtable rows
By anilkumar_vist in forum Advanced JavaReplies: 2Last Post: 09-17-2010, 08:03 AM -
Listening rows in JTable ??
By Stephen Douglas in forum New To JavaReplies: 2Last Post: 04-10-2010, 04:45 PM -
display rows in jtable
By osval in forum AWT / SwingReplies: 1Last Post: 08-06-2007, 08:54 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks