Results 1 to 1 of 1
Thread: DragImage while dnd
- 12-19-2010, 01:26 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 20
- Rep Power
- 0
DragImage while dnd
Hello,
I have set up a Drag and Drop feature in my application using the java.awt.dnd package. It all works well but for the drag image.. It just won't appear on the screen..
The piece of code covering the drag image:
TiaJava Code:public class DragListener implements DragGestureListener { public DragListener(Component component) { this.component = component; } public void dragGestureRecognized(DragGestureEvent dge) { BufferedImage image = null; try { image = ImageIO.read(new File("images/bin.png")); } catch (IOException e) { e.printStackTrace(); } dge.startDrag(new Cursor(Cursor.CROSSHAIR_CURSOR), image, new Point(0, 0), new TransferComponent(component), new DragSourceAdapter() { @Override public void dragEnter(DragSourceDragEvent e) { // here goes some animation } }); } private Component component; }


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks