The Source for Java Technology Collaboration

Home » java.net Forums » Mobile & Embedded » ME Application Developer Interest

Thread: How to implement drag & drop with J2ME CDC

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 2 - Last Post: May 17, 2008 1:32 AM by: terrencebarr Threads: [ Previous | Next ]
blackfrancis007

Posts: 1
How to implement drag & drop with J2ME CDC
Posted: May 15, 2008 1:15 AM
  Click to reply to this thread Reply

Hello
I would like to use drag & drop in a PDA application.
I would be using J2ME CDC, and I don't find on the J2ME javadoc the interfaces used on J2SE to implement the drag & drop (DragGestureListener, DropTargetListenner,...).

My question is : is there any way to implement the drag & drop using J2ME CDC, and if not how is implemented the drag & drop on the PDA applications (because it seems to me that it's a basic concept of the PDA programmation)?

Thanks in advance for your responses

sfitzjava

Posts: 263
Re: How to implement drag & drop with J2ME CDC
Posted: May 15, 2008 8:30 AM   in response to: blackfrancis007
  Click to reply to this thread Reply

Hi,

So JavaME was designed for limited devices, as such incorporating large libraries to support the DnD type features was not included. A rule of thumb is if it wasn't in Java before 1.2 then it most likely isn't in JavaME CDC. I don't work in CDC but rather the CLDC, however you might see if the java.awt.datatransfer package is available to help with the transfer of information. The DnD really become a graphical management issue of working with mouse events. I found this example of the use of the java.awt.datatransfer package, and it looks like it doesn't have code that is outside the 1.1.8 spec.
http://www.java2s.com/Code/Java/Swing-JFC/DroppershowFileDropTargetfromDragnDrop.htm

But if you have a JavaVM that support CDC, you might look at the Gnu ClassPath project, and see if you could use their implementation of the awt.dnd package. All of the bytecode opCodes should be in the VM to support the java portion of the package. If there is native code then you will have troubles.

Regards,
-Shawn

terrencebarr

Posts: 544
Re: How to implement drag & drop with J2ME CDC
Posted: May 17, 2008 1:32 AM   in response to: blackfrancis007
  Click to reply to this thread Reply

I am not an expert on DnD but platforms such as phoneME Advanced are CDC/FP/PBP/PP and as such most of the Java SE 1.4.2 functionality, including awt.datatransfer . You could certainly try that.

Hope that helps,

-- Terrence




 XML java.net RSS