Open Source JavaFX Now!

JFXtras Core Logo

XWorker

Here is an example that will load an Image and set it to a variable when the load is completed:

var currentImage:Image;
var worker = JavaFXWorker {
     inBackground: function() {
       return Image {url: currentFile.toURL().toString(), height: imageHeight};
     }
      onDone: function(result) {
      currentImage = result as Image;
     }
 }

 

Warning: This appears to currently require download.java.net/javadesktop/swinglabs/releases/0.8/swinglabs-0.8.0-bin.zip

0 Attachments 0 Attachments
354 Views