Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #38019
| Newsgroups | comp.lang.java.programmer |
|---|---|
| Date | 2018-02-12 08:56 -0800 |
| References | <9b73b344-ccfd-4046-90ba-b0980bb1a8c6@googlegroups.com> <65e4e9fb-4b25-4c58-bc6f-ebf6b7ca9e3b@googlegroups.com> |
| Message-ID | <c71ae87e-39e3-4474-9cd2-2559fda1765f@googlegroups.com> (permalink) |
| Subject | Re: How to listen for drag/drop events? |
| From | Eric Douglas <e.d.programmer@gmail.com> |
I believe I've found a suitable workaround. I have a custom DocumentFilter on my control. I override insertString which is accepting all text from a drag/drop at once, but I process each character in a loop to determine if, where, and how it should be allowed in the control using custom input masks. This method passes in a DocumentFilter.FilterBypass which I use to update what is currently displayed in the control, which is reporting each update to the DocumentListeners one character at a time. At the end of the insertString and remove methods for each of my filters, I call a setText() method which puts the full updated display String in a custom field in one abstract filter class, the super class for all 3 filters. I can report the "key change events" here and it gives me one event for every keypress or drag/drop which changes the control's value.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread
How to listen for drag/drop events? Eric Douglas <e.d.programmer@gmail.com> - 2018-02-09 11:51 -0800
Re: How to listen for drag/drop events? Eric Douglas <e.d.programmer@gmail.com> - 2018-02-09 13:44 -0800
Re: How to listen for drag/drop events? Eric Douglas <e.d.programmer@gmail.com> - 2018-02-12 08:56 -0800
csiph-web