Solved

getting the file path name dropped on the application icon

Posted on 2003-11-04
11
1,290 Views
Last Modified: 2010-03-31
I want to create an application which is represented as an icon on the desktop and the user could drag files and drop them on the top of the icon and thus the application should be able to get the file path name and store it in a text file. Please help I have no idea how to start. I am using java and Windows xp platform.
0
Comment
Question by:ibaj1
11 Comments
 
LVL 92

Accepted Solution

by:
objects earned 63 total points
ID: 9683286
0
 

Author Comment

by:ibaj1
ID: 9683392
I don't want the application to opene when the file is dragged to the icon and also  don't want to use swing libraries, it is just a simple application that gets the files names dragged to it.....help pleeeeeeeeease
0
 
LVL 20

Assisted Solution

by:Venabili
Venabili earned 62 total points
ID: 9683608
I do not think it is possible. The build in DND in java is with the Swing classes

0
 
LVL 92

Expert Comment

by:objects
ID: 9683665
> also  don't want to use swing libraries

then you can't use dnd with Java.
You need a Swing component to drop the file onto.

If you just want to drop the file onto a Windows icon then it's not a Java problem, you need to write a Windows application.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:ibaj1
ID: 9683772
How would I write a Windows application? Is there any tutorials? I need as much help as I could
0
 
LVL 92

Expert Comment

by:objects
ID: 9683820
0
 
LVL 7

Expert Comment

by:maheshexp
ID: 9684259
>How would I write a Windows application? Is there any tutorials? I >need as much help as I could

u mean AWT application....

http://java.sun.com/docs/books/tutorial/applet/practical/gui.html
0
 
LVL 92

Expert Comment

by:objects
ID: 9684268
You can't do it with AWT.
And an applet is certainly not suitable.
0
 
LVL 7

Expert Comment

by:tomboshell
ID: 9685017
And I don't think that is possible with just an icon sitting on the desktop.  The icons are short-cuts to program executables, interacting with it tells the OS to start the associated program.  It *might* work if you have your main method accept the first parameter as being the file name, and *hope* that is what is sent to the program when it is activated.  Then have it run some code (no need for a gui since you only want to append that name to a file), and then exit.  Give it a try, I'm sure that you already have some code in mind.  You will need to ensure that the javaw.exe is associated with the jar file in the OS, then print out the command-line arguments your receive (if any) in your main.  

If it doesn't work then research the theme "Active Desktop".  Or like Objects said write a Windows program.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now