Skip to main content

I have some trouble with removing row in JXTable.

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
5 replies [Last post]
piniubee
Offline
Joined: 2013-08-07

When I click on “Clear” -> the selected row will be deleted (success 100%).
But the last row is still showed. Maybe the ViewPort is not updated.

After adding images:

After delete row #2:

This is my video about my error:

Besides, JXTable doesn’t auto update the ViewPort. The ViewPort only update when I move my mouse to JXTable


This is my code:

public class MyTableModel extends AbstractTableModel {
public MyDataRow deleteRow(int nRowIndex)
{
//m_arrDataRows: ArrayList
                //MyDataRow containts Object[]
MyDataRow rowDeleted = m_arrDataRows.remove(nRowIndex);
fireTableRowsDeleted(nRowIndex, nRowIndex);

return rowDeleted;
}
}

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kleopatra
Offline
Joined: 2003-06-11

is this different from doing the same with a plain JTable? If so, we need a SSCCE that demonstrates the problem. If not, you are better of in a basic swing forum - here we are highly focused on SwingX :-)

Cheers
Jeanette

piniubee
Offline
Joined: 2013-08-07

I think JXTable belongs to SwingX. So I post my problem into this forum.

Excuse! What does "SSCCE" mean? My English isn't good. So please tell me the clearly :D.

kleopatra
Offline
Joined: 2003-06-11

sure, JXTable belongs to SwingX - but you have to check that the problem _only_ happens with JXTable, that is _not_ with JTable.

As to the SSCCE, Google (or your preferred search engine) is your friend :-) Hint: we need a code example that demonstrates the behaviour.

Cheers
Jeanette

piniubee
Offline
Joined: 2013-08-07

Hi kleopatra !

Long time no see ! :)
I'm sorry about replying late :).
This is my project which has an error about JXTable. My code is very clear and short.
Would you mind reading my project and help me ?!?!

This is my project link:
- Preview:
https://docs.google.com/file/d/0B-7_9kfJKwjSSjY2RkhmZ1lMUVk/edit

- Download:
https://doc-0c-7c-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7...

I have searched on google.com about this problem but I can't find the way to solve it. So I ask my question on this forum.
Please help me!

Thanks in advance !

kleopatra
Offline
Joined: 2003-06-11

sorry, no - that's not how public forums work ;-)

It's your job to here show a SSCCE that demonstrates the problem - _after_ confirming that it is JXTable only (that is that the same setup works fine with a core JTable.

Cheers
Jeanette