Sorting the Model vs sorting the JTable

So,
now that I'm starting the rewrite of my program, I wanted to avoid as much dependencies as possible from the table component.
This, because my table (SwingX JXTable actually) gave me occasional problems and artefacts.
So, when I want to sort the data in the table, or filter it for example,
would it be faster to:
- sort the data model and reset the data in the table
or
- don't do anything with the model and let the table do the sorting and filtering?
Thanks in advance.

To OP:
Your question is contradictory.
First you want to avoid dependencies "from the table component" (I ssume you mean "on JXTable API"). Then you go on asking what would be "faster".
Other criteria that might be of interest (in addition to "dependencies maintenance" and "speed"), could be:
- memory usage: if you already know to filter, at the model level, your 1-M customer orders table, into a 10-lines summary for the current customer, then obviously you'll gain memory at the view level.
- ease of programming: if all order data are in-memory, and you can switch from one customer to the other, filtering at the view level spares one call into the model layer, and probably one DB call as well. A UI developper will be more confortable.
These are contrived examples, I just want to point out that "it depends" on what are your constraints (interactions, app-specific requirements, staff skill,...).
AFAIC, I don't remember having problems with sorting and filtering using Swing's native RowSorter API (I did shoot myself in the foot because I sometimes forgot to convert indices, view-to-model and model-to-view, in the event handlers, but once you remember that you're safe).
Maybe check on a SwingX forum for the (maybe SwingX-specific) artefacts.
Edited by: jduprez on Jul 13, 2009 7:10 AM

Similar Messages

Maybe you are looking for

  • How to desable default close icon in jtree

    how to desable default close and open icon in jtree.

  • Show in Explorer option not working

    Recently started using Lightroom. But I have a problem. When I right click on a picture and select Show in Explorer nothing happens. Any ideas much appreciated.

  • Why is the text box acting so weird??

    I am trying to do something simple that I've done a million times in Photoshop CS5 -- create a text box with some text inside. But something is going wrong and I can't quite figure it out... Notice how the text box is now much larger than the text di

  • Transport Basics: Can you explain this to me?

    Hello Experts, In Transport Organizer: Requests (se09), I double clicked on a Transport request and I could see a display of the Transport Request number (Request/Task: BWIK…..) and 3 tabs (Properties, Objects, Documentation). 1. Under Objects tab I

  • Subscription, change, one product to creative cloud, education staff

    I have a current 12-month commitment for Dreamweaver. I received an e-mail about Creative Cloud for teachers and students at $19.99. My questions: Can I upgrade my subscription from Dreamweaver to CC? As a staff member ([email protected]) can I get t