• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to select parent and all subnodes in JXTreeTable?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to select rows in JXTreeTable for clicked parent and all of its subnodes. In older Swingx with deprecated JXTreeTable it could be done with TreeSelectionListener. I had listener (mTable is deprecated JXTreeTable):



and method selectionPerformed(evt):



When I clicked "Components" event was fired few times and with list.addSelectionInterval(begin, end); selection worked fine and looked like this:



But now, with new swingx 1.6, with new JXTreeTable, when I click "Components" in debug mode, this event is fire only once, so the result looks like this :



For example if I click "admin" program selecting this row and next 3 rows with its children. but if I click "Components" I need to select this row and all rows for children and every child's children. If you know what I mean Is it any way to fire this event? Or maybe there's another way to do selection?
 
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
- the same answer as another forum post anSSCCE

- noticed that could be a bug (by @kleopatra, and most active member of SwingX team), have to post an SSCCE

- no idea where is your problem to creating an SSCCE, my code for JXTreeTable works with Selection(s) and Highlighter (long timed bug) too
 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Michal,
Welcome to the Ranch!

Apart from what has been mentioned, I would like to point out something - selection and 'expansion' are 2 different things.
Also, what you want to achieve might be dependent on if the child nodes are expanded or not. So, if you want to select all the way down the hierarchy, you must first make sure to 'expand' till the last child and then do the selection.

One more point...we have few simple policies here and one such is that, if you post the same question in other forums, we expect you to inform us of the same. That way, a responder can first check the other forums to see if they are not already answered. You can read about this here: BeForthrightWhenCrossPostingToOtherSites
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic