Results 1 to 2 of 2
- 09-03-2009, 10:25 AM #1Member
- Join Date
- Sep 2009
- Rep Power
How to: draw line between 2 nodes of 2 trees
I have 2 JTree on 2 JScrollPane. Now I need to draw a line from one selected node in the right tree to one in the left tree with the same name (node's name).
I do not know how to draw line between 2 components like that. Could you give me some advices?
I saw this technique in the COMA++ system. I attach a picture from that for more understandable:
h t t p : //img168.imageshack.us/img168/3746/coma.jpg
(sorry, I can up the image since I do not have enough posts)
I will appreciate for any help. Thank you very much :)
- 09-03-2009, 07:10 PM #2
Seems like you would need to have a transparent panel that covers both JScrollPane's and then draw lines on the transparent panel. You would have to make sure the covering panel doesn't eat all the mouse and keyboard events and you would have to figure out the positioning and linking of the lines and communicate it with that panel.
Last edited by mrmatt1111; 09-03-2009 at 07:18 PM.My Hobby Project: LegacyClone
- By h8alfred in forum Advanced JavaReplies: 0Last Post: 03-27-2009, 04:05 AM
- By ventrue in forum New To JavaReplies: 2Last Post: 03-24-2009, 12:04 AM
- By wiggsfly in forum New To JavaReplies: 2Last Post: 10-26-2008, 10:38 PM
- By Java Tip in forum java.awtReplies: 0Last Post: 06-22-2008, 11:08 PM
- By johnt in forum Java 2DReplies: 1Last Post: 05-31-2007, 04:27 PM