Results 1 to 9 of 9
Thread: DnD and CCP from non jave apps
- 06-02-2011, 05:52 PM #1
DnD and CCP from non jave apps
I'm feeling a bit stupid about this topic because I just read the entire tutorial Lesson: Drag and Drop and Data Transfer (The Java™ Tutorials > Creating a GUI With JFC/Swing) and still don't understand how to actually detect the drop or CCP event. I want to be able to simply allow the user to drag or copy, cut, and paste plain text from anywhere (text file, web browser, etc.) to a JTextArea in my app. I understand all in the tutorial except how to actually detect the event. Where is the listener and how do I implement it? I'm using netbeans 6.9.1 and there are no pertinent events listed that I can see.
Any help would be greatly appreciated.
- 06-02-2011, 06:06 PM #2
Have you tried copying one of the examples from the Tutorial and getting it to work?
If you have problems, post them here.
- 06-02-2011, 06:59 PM #3
- 06-02-2011, 07:04 PM #4
Does the Document model have listeners or methods you can override for detecting when text is added to a component?
- 06-02-2011, 07:13 PM #5
- 06-02-2011, 07:16 PM #6
Yes the interface methods in the listener should be called as appropriate.
- 06-02-2011, 07:18 PM #7
Thanks. I will give that a try and let you know.
- 06-02-2011, 07:38 PM #8
That did the trick! I don't know why I can't find these things on my own. Still learning. Thanks again.
- 06-02-2011, 07:40 PM #9
- By Durden in forum New To JavaReplies: 7Last Post: 05-04-2011, 03:58 PM
- By maryjane in forum New To JavaReplies: 1Last Post: 01-15-2011, 03:48 AM
- By defanci in forum New To JavaReplies: 0Last Post: 01-06-2011, 08:15 AM
- By tetfernandez in forum Jobs OfferedReplies: 1Last Post: 01-15-2009, 01:25 PM
- By bizadi in forum New To JavaReplies: 13Last Post: 07-31-2008, 06:35 AM