Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JTable NullPointer Exception at 783 rows.

Status
Not open for further replies.

ra89120

Programmer
Joined
Mar 25, 2004
Messages
1
Location
US
Hi, we have a DB application with a java front end.

We are using JDK 1.4.2_01.

We load query results to a an TableModel and place
this into a JTable.

We then goto each row in the table to grab columns 0 - 5
using the row numbr we got from the abstract table model.

curRow = atm.getCurrentRow();

for(int j = 0; j < 6; j++)
jtLocal.getComponentAt(curRow, j).setEnabled(true);

We loop through each row like this. We can have any number of rows depending on the live, dynamic data we are drawing from.

When we reach a curRow of 783 exactly, we get a NullPointer exception at the jtLocal.getComponentAt(curRow, j).setEnabled(true);

The abstract table model gives us the curRow, but the
JTable knows nothing about that row.

Any ideas of what's happening? Is there a JTable limitation or a TableModel limitation?

Any help will be appreciated.
 
Is it possible that the number of rows change
while processing? Either behind the model or
as a side-effect?

What does 784th row return? Why are you enabling
the component? That in itself seems strange.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top