Now when a node is expanded and I click on a node's text the node.isExpanded() returns true (checking it in the listener), but when I click the arrow to the left, it returns false !!!

Wonder if this is a bug ?

sven

18 Jun 2009, 7:19 AM

No, it is not a bug. If you click the arrow, the node collapse/expands and than your listener is called. So you get the new state.

sz_146

18 Jun 2009, 7:24 AM

And is it different if you click the text instead ?

PS: Is there a better way to achieve this (may be) ?

sven

18 Jun 2009, 7:32 AM

Clicking the arrow invokes expanding, clicking else where doesnt invoke it by default. So in your click listener check if the target was the arrow, and if it was the arrow, dont do anything, as normal actions are taking place.