I'm using the jxbrowser library and I have a download link. For some reason there is no download shown.
browser.setDownloadHandler(new DownloadHandler() {
public boolean allowDownload(DownloadItem download) {
download.addDownloadListener(new DownloadListener() {
public void onDownloadUpdated(DownloadEvent event) {
DownloadItem download = event.getDownloadItem();
download.setDestinationFile(new File("C:/Users/"
+ System.getProperty("user.name")
+ "/Desktop/" + title));
}
});
return true;
}
});
browser.loadURL(downloadURL);
I'm guessing here, but if you compare your code to the sample here:
it looks like you are setting the destination for the download after the download has completed. Try setting it in the download handler rather than the download event listener.