Swing Question (Drag and Drop??)
Posted on 2001-06-12
I'm wondering if anyone could tell me (a) if the following is possible in swing and (b) if so, how you'd implement it please ! :)
I'm wondering if I could have the following situation,
a JFrame that contains 2 scroll panes,
One on the left, one on the right.
In each scroll pane there is a JTree.
I'd like to create the visual "mapping" between nodes of these two seperate trees. I.E. You click on a node in the left jtree, and drag a line to a another node in the right jtree. When you "let go" a line permenantly appears between the 2 nodes in the 2 different trees. Can this be done ??? the drawing of lines between 2 seperate components ?? Personally, I don't think it can be done in swing at the moment, but ppl around me are saying "yeah java drag and drop can do that" without giving me any details :) Sun's drag and drop tutorial is not written yet - and the javaworld one mentions nothing like the behaviour I've described above.
Any opinions/insights ????
Also as a side note ...... The default behaviour of a jtree is that it expands left-to-right, can you change it so that it expands right-to-left ??? ie "backwards".
any help/opinions greatly appreciated,