Hi all,
I have a JavaFX app with a some code like this...
public class MainListener extends EventListener{
override public function event (arg0 : String) : Void {
statusText.content = arg0;
}
}
statusText is defined like this...
var statusText = Text {
x: 30
y: stageHeight - 40
font: Font { name: "Bitstream Vera Sans Bold" size: 10 }
wrappingWidth: 420
fill: Color.WHITE
textAlignment: TextAlignment.CENTER
content: "Status: awaiting DBF file."
};
I also have some other Javacode that is load data, much like this..
public ArrayList<CustomerRecord> read(EventListener listener) {
ArrayList<CustomerRecord> listOfCustomerRecords = new ArrayList<CustomerRecord>();
listener.event("Status: Starting read");
// ** takes a while...
List<Map<String, CustomerField>> customerRecords = new Reader(file).readData(listener);
// ** long running method over.
listener.event("Status: Loaded all customers, count:" + listOfCustomerRecords.size());
return listOfCustomerRecords;
}
Now while the last method is in its long running call, I would expect to see my statusText updated to have 'Status: Starting read', but its doesn't. Its only when the read() method returns that the text is updated.
If its was 'straight' java I would presume that the long running job is hogging the CPU, or the statusText needed to have repaint() called on it.
Can anyone give me any ideas?
Thanks Jeff Porter