wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes How to display ghost image of JTable multiple row selection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to display ghost image of JTable multiple row selection " Watch "How to display ghost image of JTable multiple row selection " New topic
Author

How to display ghost image of JTable multiple row selection

Alice Corman
Greenhorn

Joined: Jun 21, 2006
Posts: 19
I am using drag and drop with a JTree. I would like to display a ghost image during the drag, similar to this old link:

http://www.javaworld.com/javaworld/javatips/jw-javatip114.html

I've been working at it for a while.. but cannot seem to adapt the example to work with multiple selections. If anyone can offer any pointers or suggestions, I would be extremely grateful.

TIA
Alice Corman
Greenhorn

Joined: Jun 21, 2006
Posts: 19
Anyone have any ideas?
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
This looked like fun so I took a stab at it.
Some hints on function:
To copy: select a node and then, with the mouse button still pressed, press and hold the
control key down until the drag is underway, drag the copied node to the target for release.
To move a single node: press and hold mouse button, drag and drop.
To move multiple nodes: Hold the control key down while making the multiple selections. On
the last selection you can release the control key and drag the selection to the drop target
for release.
Most of this code comes from the javatip 114 that you lined to and javatip 97 which it
(tip 114) linked to. It seems barely functional and needs a lot of testing.


edit: remove old tabs
[ July 18, 2006: Message edited by: Craig Wood ]
Alice Corman
Greenhorn

Joined: Jun 21, 2006
Posts: 19
Thank you so much! A working example was more than I expected. I know it needs testing but most importantly, the example really helped me understand what I was doing wrong with BufferedImage and Graphics2D. Thanks again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to display ghost image of JTable multiple row selection