Article View: borland.public.jbuilder.java.swing
Article #207Problem - cannot display rows correctly in jTable
From: dtsignopoulos
Date: Mon, 27 Nov 2006 12:30
Date: Mon, 27 Nov 2006 12:30
37 lines
2358 bytes
2358 bytes
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
Technical Details
Message-ID:
<1164630645.278561.76730@n67g2000cwd.googlegroups.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!n67g2000cwd.googlegroups.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 111d45,28c2112d9e504c5e,start X-Google-Attributes: gid111d45,public X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!n67g2000cwd.googlegroups.com!not-for-mail From: dtsignopoulos@gmail.com Newsgroups: borland.public.jbuilder.java.swing Subject: Problem - cannot display rows correctly in jTable Date: 27 Nov 2006 04:30:45 -0800 Organization: http://groups.google.com Lines: 38 Message-ID: <1164630645.278561.76730@n67g2000cwd.googlegroups.com> NNTP-Posting-Host: 143.233.238.198 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-7" X-Trace: posting.google.com 1164630651 31202 127.0.0.1 (27 Nov 2006 12:30:51 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 27 Nov 2006 12:30:51 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: n67g2000cwd.googlegroups.com; posting-host=143.233.238.198; posting-account=-f4TDg0AAADPnmpD9Irk8U93DwsQyRUz