Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #18688

Re: Sort a jtable within code

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!usenet.ukfsn.org!not-for-mail
From Martin Gregorie <martin@address-in-sig.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Sort a jtable within code
Date Wed, 12 Sep 2012 19:39:42 +0000 (UTC)
Organization UK Free Software Network
Lines 18
Message-ID <k2qodu$srk$1@localhost.localdomain> (permalink)
References <114c9b7c-7ed8-4f59-aa46-c7480a677be7@googlegroups.com>
NNTP-Posting-Host 84.45.235.129
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Trace localhost.localdomain 1347478782 29556 84.45.235.129 (12 Sep 2012 19:39:42 GMT)
X-Complaints-To usenet@localhost.localdomain
NNTP-Posting-Date Wed, 12 Sep 2012 19:39:42 +0000 (UTC)
User-Agent Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2)
Xref csiph.com comp.lang.java.programmer:18688

Show key headers only | View raw


On Wed, 12 Sep 2012 06:25:57 -0700, clusardi2k wrote:

> How can I automatically sort a Jtable by a specific column within code,
> and still allow the user to (later) sort any column by clicking on the
> specific table header.
>
I've done it by initially loading a concrete extension of the 
AbstractTableModel from a sorted list of the rows that will display in 
the JTable. I handled resorting on a user-selected column by simply 
reloading the AbstractTableModel's extension with data sorted on the 
required column. The list was sorted by extracting it from a database 
using a SELECT....ORDERED BY SQL statement.
  

-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Sort a jtable within code clusardi2k@aol.com - 2012-09-12 06:25 -0700
  Re: Sort a jtable within code Martin Gregorie <martin@address-in-sig.invalid> - 2012-09-12 19:39 +0000
  Re: Sort a jtable within code Arne Vajhøj <arne@vajhoej.dk> - 2012-09-12 20:48 -0400
  Re: Sort a jtable within code "John B. Matthews" <nospam@nospam.invalid> - 2012-09-12 21:12 -0400
    Re: Sort a jtable within code Lew <lewbloch@gmail.com> - 2012-09-12 22:51 -0700
      Re: Sort a jtable within code clusardi2k@aol.com - 2012-09-12 22:58 -0700
        Re: Sort a jtable within code clusardi2k@aol.com - 2012-09-13 07:53 -0700
      Re: Sort a jtable within code "John B. Matthews" <nospam@nospam.invalid> - 2012-09-13 23:58 -0400

csiph-web