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


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

Re: Sort a jtable within code

From "John B. Matthews" <nospam@nospam.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Sort a jtable within code
Date 2012-09-12 21:12 -0400
Organization The Wasteland
Message-ID <nospam-03FC5A.21124012092012@news.aioe.org> (permalink)
References <114c9b7c-7ed8-4f59-aa46-c7480a677be7@googlegroups.com>

Show all headers | View raw


In article <114c9b7c-7ed8-4f59-aa46-c7480a677be7@googlegroups.com>,
 clusardi2k@aol.com 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.

Have you looked at Sorting and Filtering?

<http://docs.oracle.com/javase/tutorial/uiswing/components/table.html#sorting>

You can restore your TableModel's intrinsic order as shown here:

<http://stackoverflow.com/a/5484298/230513>

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

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