« Return to Thread: EventListJXTableSorting
Actually, my list IS initially sorted, which is what I expected. I thought
that since I was passing the sortedList to my EventTableModel, it would sort
initially. Is that not correct?
My application creates a list of images and displays them in the JXTable. I
would like the image list to be sorted by size initially. That is what
happens when I don't call EventListJXTableSorting.install( ... ).
Also, if I add a FilterList to the table, everything appears to work until I
change the filter. Once the I change the filter, I only get one entry, no
matter what else I try.
James Lemieux wrote:
>
> Steve,
>
> I'm unsure of what your exact problem is. In GL, tables stay unsorted
> until you click on the header once. We don't have the concept of a default
> table order (yet). What is incorrect about not sorting the table until the
> header is clicked?
>
> James
>>> HighlighterFactory.createAlternateStriping(),
> On 7/25/07, Steve Newell <newellista@...> wrote:
>>
>> I am attempting to create a table using JXTable and glazedLists. My
>> problem is the sorting. Things seem to work fine UNLESS I call
>> EventListJXTableSorting.install( imageTable, sortedList );
>>
>> When I add that call, the table is not sorted until I select one of the
>> headers.
>>
>> Here is the method that creates the table:
>>
>> private JScrollPane getFilteredList()
>> {
>> JScrollPane scrollImageTable = null;
>>
>>
>> imageList.getReadWriteLock().writeLock().lock();
>> try
>> {
>> SortedList< ImageSignature > sortedList = new SortedList< ImageSignature
>> >( imageList, new ImageSizeComparator() );
>> EventTableModel< ImageSignature > tableModel = new EventTableModel<
>> ImageSignature >( sortedList, new ImageTableFormat() );
>> JXTable imageTable = new DroppableTable( tableModel );
>>
>> EventListJXTableSorting sorting = EventListJXTableSorting.install (
>> imageTable, sortedList );
>> sorting.setMultipleColumnSort( false );
>>
>> scrollImageTable = new JScrollPane( imageTable );
>>
>> imageTable.setHighlighters(
>> new RolloverHighlighter( Color.BLACK, Color.white ) );
>> imageTable.setRolloverEnabled( true );
>> imageTable.setHorizontalScrollEnabled ( true );
>>
>> imageTable.setSelectionMode( ListSelectionModel.SINGLE_SELECTION );
>> imageTable.setColumnControlVisible( true );
>>
>>
>> TableSelectionListener selectionListener = new TableSelectionListener(
>> imageTable );
>> imageTable.getSelectionModel().addListSelectionListener(
>> selectionListener );
>> }
>> finally
>> {
>> imageList.getReadWriteLock ().writeLock().unlock();
>> }
>>
>>
>> return scrollImageTable;
>> }
>>
>
>
--
View this message in context: http://www.nabble.com/EventListJXTableSorting-tf4148508.html#a11834765
Sent from the GlazedLists - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...
« Return to Thread: EventListJXTableSorting
| Free embeddable forum powered by Nabble | Forum Help |