Re: JTree problem (0/1)



On 1 Apr 2005 02:07:43 -0800, "jonck" <jonck@xxxxxxxxxxxxxxx> wrote:
>Actually I've experienced this just recently. I found out that to solve
>this, instead of creating a two-argument TreeModelEvent(Object sourc,
>TreePath path), you need to create a 4-argument TreeModelEvent(Object
>source, TreePath path, int[] childIndices, Object[] children).
>Note that the second argument here differs depending on which
>fireTreeNodeXXX method you're going to call. When calling the
>fireTreeNodesInserted or fireTreeNodesRemoved method, the path argument
>should be a path leading to the parent. When you want to call the
>fireTreeNodesChanged method the path argument should be a path leading
>to the child.
>
>Regards, Jonck


Thanks! This actually works for me. The other solution suggested in this thread makes sense to me as well. However it
did not seem to work. Using the 4 arg constructor of the TreeModelEvent works like a charm though. In hindsight the
javadoc makes sense as well.

Thanks for your input.

Vincent

.