JXTable selection issue
Hi all,
I am using a JXTable from SwingX in my application. I'm not sure why I get this exception, but it is annoying. It happens when I update my table by clearing out the model and updating it. This happens on the latest release of GlazedLists. The exception is as follows:
java.lang.IndexOutOfBoundsException: Invalid range for selection: 2-2, list size is 2
at ca.odell.glazedlists.ListSelection.setSubRangeOfRange(ListSelection.java:997)
at ca.odell.glazedlists.ListSelection.select(ListSelection.java:610)
at ca.odell.glazedlists.swing.DefaultEventSelectionModel.addSelectionInterval(DefaultEventSelectionModel.java:234)
at ca.odell.glazedlists.swing.EventSelectionModel.addSelectionInterval(EventSelectionModel.java:101)
at org.jdesktop.swingx.decorator.DefaultSelectionMapper.mapTowardsView(DefaultSelectionMapper.java:122)
at org.jdesktop.swingx.decorator.DefaultSelectionMapper$1.contentsChanged(DefaultSelectionMapper.java:278)
at org.jdesktop.swingx.decorator.FilterPipeline.fireContentsChanged(FilterPipeline.java:556)
at org.jdesktop.swingx.decorator.FilterPipeline.filterChanged(FilterPipeline.java:374)
at org.jdesktop.swingx.decorator.Filter.fireFilterChanged(Filter.java:361)
at org.jdesktop.swingx.decorator.Filter.refresh(Filter.java:350)
at org.jdesktop.swingx.decorator.Filter.refresh(Filter.java:74)
at org.jdesktop.swingx.decorator.FilterPipeline$IdentityFilter.refresh(FilterPipeline.java:636)
at org.jdesktop.swingx.decorator.FilterPipeline.flush(FilterPipeline.java:499)
at org.jdesktop.swingx.JXTable.use(JXTable.java:1732)
at org.jdesktop.swingx.JXTable.tableChanged(JXTable.java:1503)
at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:280)
at ca.odell.glazedlists.swing.DefaultEventTableModel.handleListChange(DefaultEventTableModel.java:122)
at ca.odell.glazedlists.swing.DefaultEventTableModel.listChanged(DefaultEventTableModel.java:100)
at ca.odell.glazedlists.event.ListEventAssembler$ListEventFormat.fire(ListEventAssembler.java:412)
at ca.odell.glazedlists.event.ListEventAssembler$ListEventFormat.fire(ListEventAssembler.java:409)
at ca.odell.glazedlists.event.SequenceDependenciesEventPublisher$SubjectAndListener.firePendingEvent(SequenceDependenciesEventPublisher.java:445)
at ca.odell.glazedlists.event.SequenceDependenciesEventPublisher.fireEvent(SequenceDependenciesEventPublisher.java:344)
at ca.odell.glazedlists.event.ListEventAssembler.commitEvent(ListEventAssembler.java:316)
at ca.odell.glazedlists.impl.gui.ThreadProxyEventList$UpdateRunner.run(ThreadProxyEventList.java:231)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
Any thoughts would be much appreciated.
Cheers,
Jonathan Giles