Win a copy of Securing DevOps this week in the Security forum!

ramswaroop ram

Greenhorn
+ Follow
since Oct 25, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by ramswaroop ram


how to achieve "startEditingAtPath" in JXTreeTable.. As JXTreeTable dont have startEditingAtPath method.
6 years ago
how to implement setInvokesStopCellEditing in JXTreetable.
JXTreetable does not inherit "setInvokesStopCellEditing " method.
Is there any alternate way to make leaf editable..?
6 years ago
Thanks Gregg Bolinger.. It really healped me..
6 years ago
If it has to be created then please post getComparator() meathod.

Here is my code:
if(actionCommand.equals("Sort")){
DefaultMutableTreeNode lastDt=(DefaultMutableTreeNode)selPath.getLastPathComponent(); //I am using Jpopup and this selects the path of the node selected
DefaultMutableTreeNode parent = (DefaultMutableTreeNode)lastDt.getParent(); //this gives last selected path node's parent
if (parent == null) return; //from here I am using code from Ove Lindström's link
if (parent instanceof DefaultMutableTreeNode) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) parent;
ArrayList children = Collections.list(node.children());
Collections.sort(children, this.getComparator()); // --------------------------------- as OrderedTreeModel is not yet implemented i am getting error here----------------------------------
node.removeAllChildren();
Iterator childrenIterator = children.iterator();
while (childrenIterator.hasNext()) {
node.add((DefaultMutableTreeNode) childrenIterator.next());
}
}

}
6 years ago
Thank you Ove Lindström for the link.
do we need to import some library to implement OrderedTreeModel
or do we need to create our own.


6 years ago
I have a problem in sorting nodes.
please post the code for sorting nodes.

6 years ago
Hi Suganthi,

I am trying to add and delete and sort nodes on rightclick.(jpopup) but facing some problem.
Can you please send me your code.

Regards
swaroop
6 years ago