BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem - cannot display rows correctly in jTable

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder Java
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Mon Nov 27, 2006 6:46 pm    Post subject: Problem - cannot display rows correctly in jTable Reply with quote



There seems to be a problem with processing and inserting large (>2000)
amounts of data into jtable.

I read single rows from a database, do some processing and use
insertrow() to feed them to jtable. They get to be displayed (UI) as
soon ALL rows are done and over with, whereas the desired functionality
is to be displayed as soon as they are entered (row by row).

Need help as this is turning up to take too much time to figure out.
Have tried several approaches with no luck.

Some code is listed below:

// Create staff
DefaultTableModel model_matrix = new DefaultTableModel();
JScrollPane jScrollPane_matrix = new JScrollPane();
JTable jTable_matrix = new JTable(model_matrix) {
public boolean isCellEditable(int rowIndex, int vColIndex) {
return false;
}

// Add some columns
model_matrix.addColumn("Timestamp");
model_matrix.addColumn("hpic");

//Insert rows
while (more db rows...){
read row...
process row...
//insert row
i = model_matrix.getRowCount();
model_matrix.insertRow(i, new Object[] {timestamp, HPIC});
model_matrix.fireTableRowsInserted(i,i); setSelectedRow(i);

}

Need help, thanxs
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder Java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.