These actions have unique platform-specific implementations for Mac and Windows. When you request either action you'll receive a FileOperation
if they are supported on the current platform, or null
if they are not.
The Desktop class will support these features in Java 1.9, but this is currently being written for Java 1.8 compliance.
With that painful experience in mind I built some indeterminate dialog feedback for these actions. The dialogs didn't need a functioning "Cancel" button because once we issue the command we can't abort. But the dialogs should be able to transition to error/feedback dialogs if necessary.
If the action takes longer than that threshold: an indeterminate (uncloseable) dialog is shown until the action completes. (If you called the action on the event dispatch thread: a new thread is created to execute the action and we set up a secondary event loop on the EDT until the action can complete.)
Both actions return a boolean indicating "success" or "failure". If they return "failure" or throw an exception: then we'll show an error dialog indicating what went wrong.
Design-wise you may argue that the "reveal" action showing an error dialog is redundant feedback. (Because the user can see it failed.) But the "move to trash" action definitely needs a layer of feedback because if we say nothing: the user will assume it was successful. In fact you probably want to go a step further and add some sort of notification in your app that the deletion was a success.