Solved

Drag 'n Drop outside Java

Posted on 2002-04-29
7
241 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
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
factorial example 4 50
eclipse apache tomcat admin console 52 123
Error in @AspectJ Based AOP with Spring 2 18
jsp insert to database example 2 47
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

821 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