• Post Reply Bookmark Topic Watch Topic
  • New Topic

windows freezes on dragNdrop from desktop

 
Johann Dobbins
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote an ftp style application. One feature allows uploads by dragging files/folders from the local file system. The code to retrieve the files is very simple:



However, as the "uploadFiles" method executes, windows "freezes" until the method completes. By freezes, I mean that I'm unable to click on any other icons, use an other apps, etc...

 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Johann Dobbins wrote:I wrote an ftp style application. One feature allows uploads by dragging files/folders from the local file system. The code to retrieve the files is very simple:



However, as the "uploadFiles" method executes, windows "freezes" until the method completes. By freezes, I mean that I'm unable to click on any other icons, use an other apps, etc...



Do you mean to say that your GUI application freezes or that your whole computer freezes. If it's the former and you're coding in Swing, then you will need to run your upload method in a background thread as discussed in this tutorial: Concurrency in Swing

If the latter, then I can't help you.
 
Johann Dobbins
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pete stein wrote:
Johann Dobbins wrote:I wrote an ftp style application. One feature allows uploads by dragging files/folders from the local file system. The code to retrieve the files is very simple:



However, as the "uploadFiles" method executes, windows "freezes" until the method completes. By freezes, I mean that I'm unable to click on any other icons, use an other apps, etc...



Do you mean to say that your GUI application freezes or that your whole computer freezes. If it's the former and you're coding in Swing, then you will need to run your upload method in a background thread as discussed in this tutorial: Concurrency in Swing

If the latter, then I can't help you.


latter. although, its not actually that the whole computer freezes. its that my desktop freezes. my gui and any other apps that are already running are still selectable.
 
Johann Dobbins
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Johann Dobbins wrote:
pete stein wrote:
Johann Dobbins wrote:I wrote an ftp style application. One feature allows uploads by dragging files/folders from the local file system. The code to retrieve the files is very simple:



However, as the "uploadFiles" method executes, windows "freezes" until the method completes. By freezes, I mean that I'm unable to click on any other icons, use an other apps, etc...



Do you mean to say that your GUI application freezes or that your whole computer freezes. If it's the former and you're coding in Swing, then you will need to run your upload method in a background thread as discussed in this tutorial: Concurrency in Swing

If the latter, then I can't help you.


latter. although, its not actually that the whole computer freezes. its that my desktop freezes. my gui and any other apps that are already running are still selectable.


solved via:

e.dropComplete(true);

(e is a DropTargetDropEvent)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!