views:

29

answers:

1

I'm trying to do something quite simple, but I'm having a hard time finding good examples on the net to what I want specifically. I'd like to somehing very similer to what it's here: Dao

It's a simple game called DAO and I just need to have a background image with 16 squares (4x4) and drag and drop the images (pieces) on each square to the others. I'm developing the interface using swing and I simply want to know a good place to find tutorials for such implementations or a simple suggestion on how to do it. Thanks in advance

A: 

Shameless plug: have a look at my simple example via my google project

http://code.google.com/p/jchronos/

There is code to drag list item across list boxes. Same should be applicable to JLabel Look at sources

http://code.google.com/p/jchronos/source/browse/trunk/src/org/jchronos/ui/QuadrantPanel.java

http://code.google.com/p/jchronos/source/browse/trunk/src/org/jchronos/ui/ArrayListTransferHandler.java

ring bearer
I found examples, like yours, of text changing list boxes and drag and drop for jtrees. But I wanted something quite simpler but I can't find any good examples...I just want to click on image and drag it to another point...on the "way" the image needs to "joined" to the mouse as it is one the examples I found. I don't want to have he icon informing the text dragging operation...I want the image
out_sider
@out_sider : sorry that the code did not impress you. Anyway, what you need to do is place JLabels with images on a grid layout. Now handle drag and drop just like it is one in examples you have seen.
ring bearer
ring bearer