Hi,
I'm wanting to create a GUI for editing the birth line of families, ala
ERWin style, where you have icons of people. You can drag drag the
people around and drag/drawing lines from one person to another creates
relationships, and right clicking on the person gives you editing
options, etc... Also perhaps double clicking on a person reveals/coceals
all the people/offstringunder him.
I'm not too sure about how to approach this. What's the best way to get
the draggable behaviour? Should I create a Person class that extends a
JComponent? Are there any tutorials for this sort of thing out there? (I
tried Google but all it found was Drag and Drop data transfer tutorials
between Java and other apps).
Any pointers much appreciated. Cheers,
Mike
Andrew Thompson - 11 Dec 2005 09:09 GMT
> ...(I
> tried Google but all it found was Drag and Drop data transfer tutorials
> between Java and other apps).
The principles of D'n'D between apps. and within a single app.
are the same. The reason tutorials concentrate on 'between apps.'
is probably to prove the Objects originated in the first app.,
before being dragged to the second.
I doubt you will find a more specific tutorial on D'n'D than
an inter-app. example. Once you get your feet wet with a
single D'n'D app. (which can seem quite daunting at first)
D'n'D will cease to be as mysterious, and it should become
clear how to change the example app. to suite your needs
(it often comes down to making a single component responsible
for both drags and drops).
HTH

Signature
Andrew Thompson
physci, javasaver, 1point1c, lensescapes - athompson.info/andrew