Results 1 to 2 of 2
Thread: Swing drag & drop question
- 01-05-2012, 06:07 PM #1
Member
- Join Date
- Jan 2012
- Posts
- 1
- Rep Power
- 0
Swing drag & drop question
Hi,
Here is a photo of the application I'm running:

My task is to drag the ship photo/label/button from the left panel to the right one and drop it over a cell.
My question is what classes/methods I have to use and how(extend/implement/etc..)?
(I tried using TransferHandler("icon"), with this I didn't manage to get any information about the action so it just pops into a single cell and changes it's size.)
Thanks in advance.
- 01-06-2012, 03:37 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Re: Swing drag & drop question
It's all about DnD (Drag and Drop) in Java. Basically you have to think about three levels.
1. Drag source
2. Data transfer
3. Drop source
Following document explains the all. Have a look at it and if you are stuck on anything let us know.
Lesson: Drag and Drop and Data Transfer (The Java™ Tutorials > Creating a GUI With JFC/Swing)
Pay your attention that, in DnD with IO process still there are some of know issues exist (I haven't check them with Java 7 and such). Worth to have a look around.
Similar Threads
-
Need help with drag and drop
By NixasMuraki in forum New To JavaReplies: 2Last Post: 06-07-2011, 01:55 AM -
drag and drop
By Dean29126 in forum New To JavaReplies: 0Last Post: 01-18-2011, 07:07 AM -
how to create gui(swing)by eclipse drag and drop type
By javastuden in forum EclipseReplies: 1Last Post: 03-14-2010, 10:03 PM -
drag and drop - disable intra component drop
By tomba in forum AWT / SwingReplies: 4Last Post: 12-09-2009, 01:01 PM -
Drag and Drop
By carderne in forum New To JavaReplies: 0Last Post: 08-31-2009, 09:18 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks