Solved

Drag 'n Drop outside Java

Posted on 2002-04-29
7
246 Views
Last Modified: 2010-03-31
I want to make a dialog in a Java application containing a JList (Swing) .. I need to drag an item from this JList and drop it outside the dialog in a text editor (Microsoft Front Page for example)
0
Comment
Question by:Lion24
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 7

Expert Comment

by:tomboshell
ID: 6979756
a quick-n-dirty solution...

Try getting the system clipboard.  You will have to use the abstract method 'getSystemClipboard()' from the Toolkit found in the java.awt package.  Then you can set the contents of the list entry in the clipboard and do a paste operation in any other application that has copy-paste enabled.  The clipboard class can be found in java.awt.datatransfer.  
0
 

Author Comment

by:Lion24
ID: 6985681
I think I want more clarification .. plus I need drag and drop not copy and paste. If anyone has a sample code or can recommend a website I would be very grateful.

Thanx
0
 

Author Comment

by:Lion24
ID: 6985930
I think I want more clarification .. plus I need drag and drop not copy and paste. If anyone has a sample code or can recommend a website I would be very grateful.

Thanx
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Lion24
ID: 6985932
I think I want more clarification .. plus I need drag and drop not copy and paste. If anyone has a sample code or can recommend a website I would be very grateful.

Thanx
0
 
LVL 7

Accepted Solution

by:
tomboshell earned 200 total points
ID: 6988043
That would be interesting.  I'm not sure how that would work with interacting with another non-Java program on whatever platform you are using.  So far as I know (with a grain of salt in that I haven't yet had to program drag-n-drop) the dnd for java is meant to work with Java.  That was why I suggested the copy-paste solution.  I know that the needed libararies are found in the java.awt.dnd directory (if you have the javadocs)
the java tutorial section on the subject: http://java.sun.com/docs/books/tutorial/dnd/index.html
0
 
LVL 9

Expert Comment

by:Venci75
ID: 7992665
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Answered by: tomboshell
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venci75
EE Cleanup Volunteer
0
 

Expert Comment

by:SpideyMod
ID: 8048322
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question