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


Groups > comp.lang.java.gui > #3139

Re: Sortable Java Tree Ta

From "Rogan Dawes" <rogan.dawes@THRWHITE.remove-dii-this>
Subject Re: Sortable Java Tree Ta
Message-ID <d9ydnVe-Y5a3CSzanZ2dnUVZ8sylnZ2d@saix.net> (permalink)
Newsgroups comp.lang.java.gui
References <8848a2e2-978e-4a69-90f9-ecdf58057d09@1g2000hsl.googlegroups.com>
Date 2011-04-27 15:43 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
arvim85@gmail.com wrote:
> anyOne give detailed idea of doing sorting for JTreeTable.....??
> i cant understand the already posted things....need of some
> detailed .......

What can't you understand?

The big thing that I was trying to point out in this thread, and which 
Roedy seems to be missing repeatedly, is that sorting a *TREE* is very 
different from sorting a *TABLE*.

Yes, a JTreeTable looks like a JTable (and in fact is implemented using 
an adapter from a JTree to a JTable), but the underlying order is 
determined by the *TREE*. Note that the TreeTableModel extends 
TreeModel, not TableModel!

Once you define how you want to sort your *TREE*, we can help you with 
an implementation. So, give us some information about what is being 
represented in your tree.

Is it a filesystem? If so, sorting the *TREE* could be done by sorting 
the individual files within their directories. e.g. to Sort by file 
size. Of course, it makes no sense to sort the *directories* by size, 
since the intrinsic size of a directory is pretty meaningless unless you 
define it to be the aggregate of the sizes of the files and directories, 
for example. In *that* case, you could sort the tree nodes 
hierarchically so that the directories with the biggest contents show up 
first in the tree.

My ultimate point being: Without defining how you want to sort the tree, 
we can't help you with an implementation.

Rogan
(who is tired of this thread, and will give up on it unless someone 
actually posts useful information)

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

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


Thread

Re: Sortable Java Tree Ta arvim85@gmail.com.remove-dii-this - 2011-04-27 15:43 +0000
  Re: Sortable Java Tree Ta "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:43 +0000
  Re: Sortable Java Tree Ta "Rogan Dawes" <rogan.dawes@THRWHITE.remove-dii-this> - 2011-04-27 15:43 +0000
    Re: Sortable Java Tree Ta "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:43 +0000
      Re: Sortable Java Tree Ta "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:43 +0000
        Re: Sortable Java Tree Ta "Rogan Dawes" <rogan.dawes@THRWHITE.remove-dii-this> - 2011-04-27 15:43 +0000
      Re: Sortable Java Tree Ta "Rogan Dawes" <rogan.dawes@THRWHITE.remove-dii-this> - 2011-04-27 15:43 +0000

csiph-web