23. maj 2005 - 13:21Der er
7 kommentarer og 1 løsning
JTable, moving columns crashes application, sometimes
We have our own class, which extends JTable (via several steps though)
You can always move one, or two, or maybe five columns, but after a while, when you "pick up" a column, the applications just crashes, without any stacktrace at all.
Can be quite annoying, and very hard to find.
I understand that it's impossible for you to know what the cause is, but maybe you have ideas, or suggestions of what it might be.
Denne side indeholder artikler med forskellige perspektiver på Identity & Access Management i private og offentlige organisationer. Artiklerne behandler aktuelle IAM-emner og leveres af producenter, rådgivere og implementeringspartnere.
Well - it's a little hard to give a hint on this one, because of the other methods you've added, which we can't see and it proberly wouldn't do any good if we saw them, but this one _nrOfExtraColumns could cause a return of the wrong editor for a column that might contain a value which the editor can't edit - but I'm not sure
Have you tryed setting up a system for moving the table columns, to see if the crash happens at a specific column ?
carsten >> It happens everywhere, so it's not a special column, and not a special table.
Do you think it can have anything to do with editors? Is the editor called when moving a column? It is not after the column is moved it crashes, but during the move.
1. No - getCellEditor a'int called during a column move, but isCellEditable is !!
2. And you have 2 instance varibles which worries me, I can't see what they are doing (_nrOfExtraColumns, activeRow) and the method getSortableTableModel() and focus(e).
So, the next hint would be not to override isCellEditable(int rowIndex, int columnIndex) and see what happens, getSortableTableModel() might effect the other overrided methods and there by provide an unexpected call.
We are going to look deeper into this sometime this, or next week. Now it has started to happen when se sort tables as well (we have written our own sortabletable with a sortabletablemodel)
btw... _nrOfExtraColumns is just that, an integer telling us how many extra columns we have to the left of the tablemodel (we have a copy-column, and a delete-column) and activerow is the last selected row.
I cannot actually remember all these things since some of them were created three years ago, so it's just trial and error from here... but thanks for the attempts.
Det skal vare løst i 1.4.2_08, eller kan man måske lukke før JIT-compilern.
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.