Hi,
I have 2 JTree components on my JForm. If a user clicks on a DefaultMutableTreeNode on JTree A i want app to add it to JTree B.
public void addModule(final JTree a, final JTree b){
a.addTreeSelectionListener(new TreeSelectionListener(){
@Override
public void valueChanged(TreeSelectionEvent e) {
DefaultMutableTreeNode node = new DefaultMutableTreeNode(a.getLastSelectedPathComponent());
b.add(node);
}
});
}
I have been trying to implement this via MouseListener or TreeSelectionListener but
just cant do it right problem occurs at this location ( b.add(node); );